View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
swtransaction swtransaction is offline
external usenet poster
 
Posts: 1
Default Add row number in Excel


I have several spreadsheets that are converted in batch. The row coun
is never the same. I've tried to write some code that did no
reference a specific cell, but I'm having problems.

Here is what I have so far. The problem is the last cell is differen
in every file. I can do this with the row number in the A column, bu
I need it at the end of th spreadsheet.

- go to end row/column
- move one cell to the right
- enter row()
- copy row() from that cell to the top row in that column


ActiveCell.SpecialCells(xlLastCell).Select
Range("R4233").Select
ActiveCell.FormulaR1C1 = "=ROW()"
Range("R4233").Select
Selection.Copy
Range("R4232").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Application.CutCopyMode = Fals

--
swtransactio
-----------------------------------------------------------------------
swtransaction's Profile: http://www.excelforum.com/member.php...fo&userid=3745
View this thread: http://www.excelforum.com/showthread.php?threadid=57137