A59 is #1, A86 is #2 and A113 is #3. Can someone help me write a macro to automatically insert these #'s in sequential order. A59 will always be #1 and more #'s will be added over time.
Any help would be great!
A59 is #1, A86 is #2 and A113 is #3. Can someone help me write a macro to automatically insert these #'s in sequential order. A59 will always be #1 and more #'s will be added over time.
Any help would be great!
Last edited by rhudgins; 07-15-2010 at 05:36 PM.
Hello rhudgins,
Are you sure you want a macro to do this? You easily use a formula to increment the number.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Select A58:A84 and drag down as far as desired.
Entia non sunt multiplicanda sine necessitate
A macro would be great because the data is going to be deleted and inserted frequently.
Hello rhudgins,
Here is the macro ...
![]()
Sub AddSequenceNumbers() Dim N As Long Dim Rng As Range Dim RngEnd As Range N = 1 Set Rng = Range("A1") Set RngEnd = Cells(Rows.Count, Rng.Column).End(xlUp) Set Rng = Range(Rng, RngEnd) For Each Cell In Rng If Cell = "Trade #" Then Cell.Offset(1, 0) = N: N = N + 1 Next Cell End Sub
perfect!! Thank you!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks