divyaquamara
Board Regular
- Joined
- Jun 27, 2011
- Messages
- 67
Hi,
I want to insert a column A having serial numbers (1 2 3 4 ...) in incrementing order till the end of data in column B.
I did this manually and recoeded a macro for it. But the problem in that is it has numbers from 1 to 584 even if data in the column beside is less or more.
I have put the recorded code below.
How do I solve this problem.
Thanks in advance.
I want to insert a column A having serial numbers (1 2 3 4 ...) in incrementing order till the end of data in column B.
I did this manually and recoeded a macro for it. But the problem in that is it has numbers from 1 to 584 even if data in the column beside is less or more.
I have put the recorded code below.
How do I solve this problem.
Thanks in advance.
Code:
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Range("A2").Select
ActiveCell.FormulaR1C1 = "1"
Range("A2").Select
Selection.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
Step:=1, Stop:=584, Trend:=False