I have data that looks like that:
[TABLE="width: 72"]
<colgroup><col span="2"></colgroup><tbody>[TR]
[TD]a[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]f[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]g[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]h[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]i[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]j[/TD]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]
I want to fill the missing data in column b. that will be paralel to column a.
I wrote the attached macro
Range("B1").Select
Selection.End(xlDown).Select
Range("B7").Select
ActiveCell.FormulaR1C1 = "0"
Range("B8").Select
ActiveCell.FormulaR1C1 = "=R[-1]C"
Range("B8").Select
Selection.AutoFill Destination:=Range("B8:B16")
Range("B8:B16").Select
End Sub
my problem is that this macro does not work properly if column b is shorter or longer. How can i correct the macro that regardless the column length it will fill he missing data.
Thanks
[TABLE="width: 72"]
<colgroup><col span="2"></colgroup><tbody>[TR]
[TD]a[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]f[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]g[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]h[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]i[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]j[/TD]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]
I want to fill the missing data in column b. that will be paralel to column a.
I wrote the attached macro
Range("B1").Select
Selection.End(xlDown).Select
Range("B7").Select
ActiveCell.FormulaR1C1 = "0"
Range("B8").Select
ActiveCell.FormulaR1C1 = "=R[-1]C"
Range("B8").Select
Selection.AutoFill Destination:=Range("B8:B16")
Range("B8:B16").Select
End Sub
my problem is that this macro does not work properly if column b is shorter or longer. How can i correct the macro that regardless the column length it will fill he missing data.
Thanks