+ Reply to Thread
Results 1 to 3 of 3

Autonumber

  1. #1
    Registered User
    Join Date
    11-25-2013
    Location
    England
    MS-Off Ver
    Excel 2007, Access 2007
    Posts
    14

    Autonumber

    Hi,

    I'm looking for a piece of code that can add an auto number to a cell when the rest of the row is populated.

    It doesn't need to have a pre-fix. I've tried this:

    Please Login or Register  to view this content.
    And it works! But only for one row - it wont take the code down onto the next row.

    Can anyone give me any advice?

    Thanks

    Naomi
    Last edited by NaomiDawn; 12-05-2013 at 05:15 AM.

  2. #2
    Forum Guru XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,598

    Re: Autonumber

    Hi,

    I'm no expert in VBA, but it appears that simply:


    Please Login or Register  to view this content.
    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    11,547

    Re: Autonumber

    A couple of thoughts.
    I'm not sure that you need a macro, since you want the number in column B whenever there is data "somewhere" in rows 4 and beyond. For instance, you could use a cell formula that checks for data in column A and uses the row number to calculate the serial number in column B:
    B4: =IF(A4<>"",ROW()-3,"") and copied down will put 1,2,... whenever you enter data in column A.
    If you want a prefix you could format column B using "001-"0000
    Ben Van Johnson

+ 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. [SOLVED] Autonumber Until Certain Value then Restart
    By sperryxx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-05-2013, 04:45 PM
  2. [SOLVED] Trying to autonumber
    By nonstopcrunchy in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-29-2013, 02:51 PM
  3. [SOLVED] Autonumber
    By nik7 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-23-2013, 06:50 PM
  4. Autonumber
    By jonnygrim in forum Excel General
    Replies: 2
    Last Post: 07-17-2008, 05:22 PM
  5. [SOLVED] autonumber
    By Hardy in forum Excel General
    Replies: 4
    Last Post: 11-24-2005, 01:45 PM

Tags for this Thread

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