Posted to microsoft.public.excel.programming
|
|
Insert row numbers
I'd insert a new COLUMN A.
Dave Peterson wrote:
I'd insert a new row A.
Then pick out a column that always has data:
Option Explicit
Sub testme02()
Dim wks As Worksheet
Dim LastRow As Long
Set wks = ActiveSheet
With wks
.Range("a1").EntireColumn.Insert
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
With .Range("a1:A" & LastRow)
.Formula = "=row()"
.Value = .Value
End With
End With
End Sub
wrote:
Hi,
I need to insert row numbers to a csv file that is generated from a
spreadsheet of data. Thought I could user NumberRows() but not sure if
this is correct.
Could someone tell me the best way to insert row numbers for each row
of data. The amount of data varies each time the csv file is generated.
Thanks
Steve
--
Dave Peterson
--
Dave Peterson
|