Hi all,
i want to write VBA code to fill column A with a series number start with 1, it will be fill until the last value in column B.
Here is my code:
ActiveCell.FormulaR1C1 = "1"
Range("A2").AutoFill Range("A2:A" & Range("B" & Rows.Count).End(xlUp).Row), xlFillSeries
it works fine except when the column B has only 1 value , that mean column A should have only "1", there is an error "AutoFil method of RAnge class failed "
Any suggestion? thanks
i want to write VBA code to fill column A with a series number start with 1, it will be fill until the last value in column B.
Here is my code:
ActiveCell.FormulaR1C1 = "1"
Range("A2").AutoFill Range("A2:A" & Range("B" & Rows.Count).End(xlUp).Row), xlFillSeries
it works fine except when the column B has only 1 value , that mean column A should have only "1", there is an error "AutoFil method of RAnge class failed "
Any suggestion? thanks