benneesham
New Member
- Joined
- Mar 24, 2009
- Messages
- 3
I have a macro that formats a sheet of postcodes for our use.
one of the functions is to filldown two seperate columns by the length of the adjacent column, with a formula that is enetered in cell 2, 1.
When I run the macro the second filldown column skips the blanks that can appear in the data and fills the formula down to the last row in its relative column, which is perfect, but this doesnt happen on the first column.
The first column it tries to filldown is affected by blanks and stops the fill.
Any reasons for this and suggestions on how to change?
Code below:
Column 1 fill
rng.Offset(0, 4).Cells(2, 1).FormulaR1C1 = "=COUNTIF(C[-2],RC[-1])"
Range(rng.Offset(0, 3).Cells(2, 1), rng.Offset(0, 3).End(xlDown)).Offset(0, 1).FillDown
Column 2 fill:
rng.Offset(0, 8).Cells(2, 1).FormulaR1C1 = "=COUNTIF(C[-2],RC[-1])"
Range(rng.Offset(0, 7).Cells(2, 1), rng.Offset(0, 7).End(xlDown)).Offset(0, 1).FillDown
Regards
Benn
one of the functions is to filldown two seperate columns by the length of the adjacent column, with a formula that is enetered in cell 2, 1.
When I run the macro the second filldown column skips the blanks that can appear in the data and fills the formula down to the last row in its relative column, which is perfect, but this doesnt happen on the first column.
The first column it tries to filldown is affected by blanks and stops the fill.
Any reasons for this and suggestions on how to change?
Code below:
Column 1 fill
rng.Offset(0, 4).Cells(2, 1).FormulaR1C1 = "=COUNTIF(C[-2],RC[-1])"
Range(rng.Offset(0, 3).Cells(2, 1), rng.Offset(0, 3).End(xlDown)).Offset(0, 1).FillDown
Column 2 fill:
rng.Offset(0, 8).Cells(2, 1).FormulaR1C1 = "=COUNTIF(C[-2],RC[-1])"
Range(rng.Offset(0, 7).Cells(2, 1), rng.Offset(0, 7).End(xlDown)).Offset(0, 1).FillDown
Regards
Benn