+ Reply to Thread
Results 1 to 5 of 5

Auto Serial No

  1. #1
    Registered User
    Join Date
    10-08-2008
    Location
    India
    Posts
    14

    Auto Serial No

    I would like to write a macro by which S.No column will be numbered automatically whenever name column is filled. Could anyone help to write the macro? I have attached a sample file to work out.List.xls

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Auto Serial No

    Do right click on sheet tab and select view code and paste the below code.

    Any change in Column-B cell will add serial no to column-A.

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    10-08-2008
    Location
    India
    Posts
    14

    Re: Auto Serial No

    Thanks for the prompt response. It generates numbers nicely. But facing problem, if i delete any name from the list. Once I remove all names, the numbers remains in the column which is not required. It also removes column header and changing it to no ['S.No' to '1']. Please help to rectify.
    Last edited by omdkhaleel; 06-03-2013 at 06:13 AM.

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Auto Serial No

    Try this, Drag the function down the page.
    Attached Files Attached Files
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Auto Serial No

    Try this...

    Please Login or Register  to view this content.
    The code runs from B5 cell to down.. so no possibility to delete the Sl No. as per your sample data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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