+ Reply to Thread
Results 1 to 3 of 3

Add to Autonumbering macro!

  1. #1
    Forum Contributor
    Join Date
    03-22-2006
    Location
    UK
    MS-Off Ver
    Office 2013
    Posts
    275

    Add to Autonumbering macro!

    Hi all

    I have found this code which inserts a sequential number in Column A skipping any blank rows.

    Please Login or Register  to view this content.
    This does the job fine but I need to prefix the number with the letter S.

    The other problem that I have with this code is that I have to adjust the row numbers manually because after the last applicable row, there is some summary information which should not be included with the numbering.

    The summary information is seperated by a blank row, so the code just carries on unless I fix the number of rows as above. However this will change each week, some rows may be deleted and more often than not the number of rows will increase.

    The only way that I can think of resolving this is to modify the code so that it stops at 2 rows above a constant piece of text in the summary. In this instance G363 contains the text:

    CUSTOMER TOTAL =
    but I have no idea of how to incorporate either of these features within this piece of code.

    I originally tried using formulas to do the auto-numbering but this was very messy trying to work round the blank rows, which are not at constant intervals.

    TIA ...spellbound
    Last edited by VBA Noob; 10-01-2008 at 01:00 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Spellbound,

    This macro is based on the one you posted. It checks column "B" starting at row 5 and continues down to the last entry in column "B". The macro automatically determines the end of the dynamic range for you so you don't have to adjust the rows in the code. If the contents of cell "B" are empty then the cell in column "A" doesn't get a sequence number of "Sn".
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    03-22-2006
    Location
    UK
    MS-Off Ver
    Office 2013
    Posts
    275
    Hi Leith

    Thanks for the speedy response.

    The code works fine, I just had to alter the B5 cell reference part of the code to a column that does not contain any data after row 361.

    Regards ...spellbound

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. macro to create a macro?
    By jojotherider in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2008, 08:34 PM
  2. Macro for copy/insert into expanding table
    By Soslowgt in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-06-2008, 07:24 PM
  3. How to splitt texts into words? (collecting word and compounds)
    By wali in forum Excel Programming / VBA / Macros
    Replies: 53
    Last Post: 02-03-2008, 04:06 AM
  4. Conditional formatting macro (highlight macro)
    By c991257 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2007, 02:46 PM
  5. Need macro to move down & select next visible row
    By Fartnuckles in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2006, 10:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1