Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
fill dowb using macro
I have the following spreadsheet that shows the following coluns A and B.
Cloumn A has a ref number whci needs to be inptu into Column B, however in Column A where there is a 0 in the column below the ref number above it has to be input into column B until you come to a different ref number in cloumn A. for eg below. A1 B1 1234 1234 0 1234 5678 5678 0 5678 0 5678 7881 7881 8992 8992 0 8992 Does anyone know how to achieve this automatically. I can do it using the If statement but these can be massive files and are for inexperienced users so i want to be able for them to run this auromatically by way of Macro if possible. Thanks in anticipation once again |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
fill dowb using macro
Real simple. Done this a thousand times before.
Sub FixColumns() RowCount = 1 Do While Range("A" & RowCount) < "" If Range("A" & RowCount) < 0 Then RefNo = Range("A" & RowCount) End If Range("B" & RowCount) = RefNo RowCount = RowCount + 1 Loop End Sub "tom_mcd" wrote: I have the following spreadsheet that shows the following coluns A and B. Cloumn A has a ref number whci needs to be inptu into Column B, however in Column A where there is a 0 in the column below the ref number above it has to be input into column B until you come to a different ref number in cloumn A. for eg below. A1 B1 1234 1234 0 1234 5678 5678 0 5678 0 5678 7881 7881 8992 8992 0 8992 Does anyone know how to achieve this automatically. I can do it using the If statement but these can be massive files and are for inexperienced users so i want to be able for them to run this auromatically by way of Macro if possible. Thanks in anticipation once again |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
fill dowb using macro
brilliant , thanks very much
"Joel" wrote: Real simple. Done this a thousand times before. Sub FixColumns() RowCount = 1 Do While Range("A" & RowCount) < "" If Range("A" & RowCount) < 0 Then RefNo = Range("A" & RowCount) End If Range("B" & RowCount) = RefNo RowCount = RowCount + 1 Loop End Sub "tom_mcd" wrote: I have the following spreadsheet that shows the following coluns A and B. Cloumn A has a ref number whci needs to be inptu into Column B, however in Column A where there is a 0 in the column below the ref number above it has to be input into column B until you come to a different ref number in cloumn A. for eg below. A1 B1 1234 1234 0 1234 5678 5678 0 5678 0 5678 7881 7881 8992 8992 0 8992 Does anyone know how to achieve this automatically. I can do it using the If statement but these can be massive files and are for inexperienced users so i want to be able for them to run this auromatically by way of Macro if possible. Thanks in anticipation once again |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Fill | Excel Worksheet Functions | |||
need macro for fill down | Excel Programming | |||
Macro to fill in 1 of 10 | Excel Programming | |||
Fill Macro II | Excel Worksheet Functions | |||
Fill Down Macro | Excel Discussion (Misc queries) |