Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to select cells in column enter data then press enter NP New Users to Excel 1 February 20th 08 04:21 PM
How do I record a macro to move down and over to specific column VMH Excel Discussion (Misc queries) 2 March 13th 06 05:09 PM
Program Column B to record numerical range based on number in colm Nikole Excel Discussion (Misc queries) 2 August 17th 05 08:37 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
How to record macro to work on selected column/row? Olezhka Excel Programming 1 March 5th 04 07:30 PM


All times are GMT +1. The time now is 09:14 AM.

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

About Us

"It's about Microsoft Excel"