Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to select cells in column enter data then press enter | New Users to Excel | |||
How do I record a macro to move down and over to specific column | Excel Discussion (Misc queries) | |||
Program Column B to record numerical range based on number in colm | Excel Discussion (Misc queries) | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
How to record macro to work on selected column/row? | Excel Programming |