Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have the following script in vb: Dim LNID as range Dim i as range LastRow = .Cells(.Rows.Count, "C").End(xlUp).Row Set LNID = Workbooks("FILE1").Worksheets("CONSTANTS").Range(" I11") Do LNID = LNID + 1 Set i = Range("B2:B" & LNID) LNID.Copy i Loop Until LNID = LastRow LNID is a constant (= 0) What I want is to add a line number to Column B. So in Cell B2 there should be a 1 in there and in cell B3 a 3 should be copied. Now all the cells have the same number (there are 200 lines in column C) so the number 200 is copied to all cells in column B. it should be 1,2,3,4 etc. Can anyone help with this? |