I looked though the site with the search and saw some things that came close, but no cigar.
I have a column of numbers formated in a constant string
eg 1234121231234
The number needs to be formatted into four sections
eg 1234-12-123-1234
I have the code to put the dashes in, but I am looking for the loop statement to take it down column C reading in each number in the 1234121231234 format until the end, and replacing it one by one with the 1234-12-123-1234.
' calls the function to put the dashes in the NSN in the QRL
'First 4 of NSN
first4 = Left(NSN, 4)
'Second2 of NSN
nsn9 = Right(NSN, 9)
For Y = 1 To Len(nsn9)
second2 = Left(nsn9, 2)
Next Y
'Next3 of NSN
nsn7 = Right(NSN, 7)
For Y = 1 To Len(nsn7)
next3 = Left(nsn7, 3)
Next Y
'Last4 of NSN
last4 = Right(NSN, 4)
I have one cell with $20,000 hard coded (cell A1). In another cell I want the cell to say "20,000 Capital Raise" (cell B1). And i want B1 to link to A1 so that if i change the number in A1 it will also change in B1.
Here's what i have in B1 so far: ="$"&J6&" Capital Raise"
This produces "$20000 Capital Raise" in cell B1.
So the only thing i'm trying to figure out is how to get the comma in the $20,000 so it will read "$20,000" instead of "$20000".
I am having trouble with several IF..THEN..ELSE loops in my code, all of which are pritty much the same. I need to find rows that are formatted in a certain way, in the example below this is a clear background and Black text. I know the loop works because i have tested it without colours on a test workbook, and i know the colours are correct, but it keeps skipping over the condition, regardless of the outcome. All the variables shown are declared correctly before the loop is entered.
I have a complex sheet where rows are continuosly overwritten and new data needs to be formatted each time. My macro works great aside from the fact the conditional format formula expression adds double quotes rendering the conditional format useless. After running the macro I can go into the conditional format field, remove the quotes, and the formatting formula works as expected. So...I first did a "record macro" to grab the code for conditional formatting:
1. Delete all data after row 51. 2. Find the average cost (column 4) and delete all rows where the cost is below average. Thus only retaining rows with an above average cost. 3. Then I want to conditionally format any number in column 6 which appears more than three times. 4. I want to loop this through all worksheets in my workbook.
What I am trying to do is to loop through ALL 6 number combinations and count how many Odd & Even numbers there are in each of the 6 positions. For example, for number TEN I would like the total combinations where number TEN is Odd in position ONE, then number TEN is Even in position ONE, then number TEN is Odd in position TWO, then number TEN is Even in position TWO etc upto and including where number TEN is Odd in position SIX, then number TEN is Even in position SIX. Obviously number TEN is Even, but out of the TWELVE columns of data for each of the numbers there will be SIX with a figure in it and SIX showing ZERO. Here is the code I have so far but can't quite get it to work.
Code: Option Explicit Option Base 1 Sub Odds_and_Evens_by_Position()
I'm looking to do a check on every row after I set an autofilter. Here's a scrubbed version of what I have so far.
Sub test() max_x = Worksheets("Data").Range("B1048576").End(xlUp).Row For datarow = 3 To max_x If Worksheets("Data").Cells(datarow, 4) = "Wire" Then Worksheets("Data").AutoFilterMode = False
Im trying to make some code to go through a list of numbers, and pick the next highest number from the one entered in a form. Then I need to do some processing with that number (i need to create a worksheet with that number as the name, and place that number in a few cells on that worksheet, and the main worksheet, but thats all stuff i think i can do).
I'm trying to write a vba loop script for a list of numbers. The scrip should do:
1.Check if the numbers identical. 2.If the numbers identical give a serial number that will count the identical numbers. 3.if The numbers do not match, then start a new series of serial numbers counting.
I have the script for the serial number. Script so it will have the conditional part - so the serial number counting will start over when the number in the list changes.
Sub counter() For i = 1 To Cells(Rows.Count, "B").End(xlUp).Row If Cells(i, "B").Value "" Then Cells(i, "A").Value = i - 0 End If Next i End Sub
The final result should look like this (the colores are not needed)
I have a UPC list. Some are more than 12 digits, and some with less than 12 digits. I need to make sure there are 12 digits in each UPC. I know how to count using LEN, strip leading zeros of those UPCs that are >12 digits using RIGHT.
What I need now is any number with less than 12 digits, such as 000123, add a 4 to the beginning (4000123) and fill in '0's in between the 4 and the short UPC number to make 12 digits, 400000000123. They vary from 1 to 13 digits.
I have attached a screencap of an example source table that I am trying to write a macro to manipulate each day. Starting conditions are that I have data in column A and B. Column A would be reference numbers that may be on one line, or more likely, on multiple lines repeating with varying counts. Column B is the weight associated with each line. I would need a macro that could loop through column A, determine if the ref number has changed, and then calculate/populate column C. Column C is the % of the total weight for the unique reference number. I have illustrated this in the table using column D. This is taking me incredible manual effort to complete right now and I do know VBA, I just don't know how to loop a variable range in this case.
I am trying to design a function that grabs an average of only numbers that are within a certain deviation of the mean. I got the plan down, and have done this before without VBA, its just a user defined function will be much quicker.
The gist of what I am doing: Find the standard deviation of a range and then only find the average of numbers that fall within n deviations from the mean. I am stuck with the part that I would normally use an array code for. Here is what my array would look like:
I am wondering if I am able to display dates as text. Example: If I have a date that displays as 5/6/2014 is there anyway I can get it to display as 562014 as text?
We have a list of numbers in a spreadsheet (telephone numbers). The numbers have been put in with () around the country code and hypens separating the rest of the numbers - for example (44) 0111-123456
Is it possible to remove the formatting to just read as a full number e.g 0111123456? I have loads to do and the thought of doing it manually is painful!
is there a way to have the number formatting in Text() variable? For instance, I want to reference a cell that can change between $1.00 and $10,000,000.00.
Let's say that in A3, the number turns out to be $10,000.00.
When I put in text(a3,"$0.00") it spits out $10000.00. But if I go the other route and go text(a3,"$000,000,000) it displays "$000,010,000.00".
I create many charts with a lot of parantheses. I have to use Word tables usually so that I can align the parantheses OUTSIDE the numbers, so that the numbers are still right aligned. Is there a format option in Excel that would allow me to do the same?
I am using the following format code for the y axis of a line chart. I am shortening the axis to show 3M or 500K instead of $3,000,000 or $500,000. I can't get it to work with negative numbers, I get the full $3,000,000. Somewhere I read you can only do 3 formats in a formula. Is there a way to include negative numbers using this formatting?
However it added a "." to all positive and negative numbers regardless of whether there were decimals after it.
e.g.
10 displayed as 10. -30 displayed as (30.)
In otherwords - I am trying to find the "general" format and modify it to include brackets for negative number, and also modify it so that the positive numbers aligning with the negative numbers with the ) over hanging.
I have almost 300-400 records of such data which needs formatting. There are n number of IDs in the first column & corresponding data in columns 2 & 3.
For those rows which have identical ID numbers, I need to fill those rows with some unique shade of color. If you look at the next sheet, I have manually colored the rows & that is my desired outcome. The shade of color does not matter. It just needs to be unique for each ID.
I'm designing a spreadsheet for our department which tracks a students progress throughout their time at the school. There are 4 levelsStatementSchool Action PlusSchool ActionMonitorIn year 7, they may come into our school at Monitor level, but when they get to year 8 they may have moved to Action Plus. I want to highlight that change on my spreadsheet with conditional formatting if possible so if they go up, the cell will turn red, if they move down the list the cell will turn green.
I've created two columns on an options sheet (which holds all my data validation lists) and assigned a number to each of the levels so i can conditionally format my columns using < and > but I don't know how to write the lookup formula
I currently have account numbers formatted 1.234.5678 and need to convert them all to 1234.5678. how this can be done without manually keying 22,000 account numbers?