Macro to enter record number in column A
I suspect this is pretty simple. I need a macro to insert in column A record number beginning in cell A2 and running the length of the data which will vary. The number of records could be linked to th information in column D, which will always have data in every cell fo the length of the sheet. Many thanks -- Sandema ----------------------------------------------------------------------- Sandeman's Profile: http://www.excelforum.com/member.php...fo&userid=3244 View this thread: http://www.excelforum.com/showthread.php?threadid=52911 |
Macro to enter record number in column A
Hello
With Worksheets("YourSheet") For i = 2 to .Range("D65536").End(xlUp).Row ..Cells(i,1).Value = 'Your Number here Next i End With HTH Cordially Pascal |
Macro to enter record number in column A
Thanks Pascal. Almost there it seems. The macro puts a "1" in every cell. I need this to read consecutively. 1, 2, 3, 4, etc. Sub testnumber() With Worksheets("M_Formatted Data") For i = 2 To .Range("D65536").End(xlUp).Row Cells(i, 1).Value = 1 Next i End With End Sub -- Sandeman ------------------------------------------------------------------------ Sandeman's Profile: http://www.excelforum.com/member.php...o&userid=32440 View this thread: http://www.excelforum.com/showthread...hreadid=529115 |
Macro to enter record number in column A
Hello
Sub testnumber() With Worksheets("M_Formatted Data") For i = 2 To .Range("D65536").End(xlUp).Row Cells(i, 1).Value = i - 1 Next i End With End Sub HTH Cordially Pascal |
Macro to enter record number in column A
Thank you Pascal. C'est parfait. -- Sandeman ------------------------------------------------------------------------ Sandeman's Profile: http://www.excelforum.com/member.php...o&userid=32440 View this thread: http://www.excelforum.com/showthread...hreadid=529115 |
All times are GMT +1. The time now is 04:29 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com