LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Do while

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?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"