+ Reply to Thread
Results 1 to 26 of 26

Type auto serial number started

  1. #1
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Type auto serial number started

    Hi,
    I have a worksheet named Data and there my record will start from A2 and there i need a code of serial number started from 1001. If A2 is blank then the serial number will mention 1001 and if A2 have record then A3 will show 1002 like this. I have tried the below code but getting error. Request for help.
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    03-05-2025
    Location
    Deutschland
    MS-Off Ver
    MS Office Home & Business 2024
    Posts
    487

    Re: Type auto serial number started

    Hi,

    like this:

    Please Login or Register  to view this content.
    BR, Alexandra
    Best regards, Alexandra

    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved"

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,479

    Re: Type auto serial number started

    cysu11

    Your macro does not continue down the column.
    Try this :

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    03-05-2025
    Location
    Deutschland
    MS-Off Ver
    MS Office Home & Business 2024
    Posts
    487

    Re: Type auto serial number started

    @logit, my code continue till to the last filled cell in A, i mean this is sufficient!

  5. #5
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Dear Mr. Logit and Mr. Cysu thank you both for revert with solution. But the code of Mr.Logit works for me. I don't know why the code of Mr. Cysu not works. Sorry.
    Here i need this code to be worked in C column. Actually it's my mistake and had mentioned A column. In A column is my serial no. B is date and C is the Voucher no where i need this count started from 1001.
    Secondly how to populate this code in userform textbox 2 with added next serial number. Hope i have explained clearly. Thanks

  6. #6
    Valued Forum Contributor
    Join Date
    03-05-2025
    Location
    Deutschland
    MS-Off Ver
    MS Office Home & Business 2024
    Posts
    487

    Re: Type auto serial number started

    Hi,

    you have a sample file?

    BR, Alexandra

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    31,297

    Re: Type auto serial number started

    Based on Alexandra's code ..

    Please Login or Register  to view this content.
    puts Voucher number in column C

    Post file with Userform
    Last edited by JohnTopley; 06-28-2025 at 02:43 PM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Type auto serial number started

    If it's the Transaction file we're talking about your data starts at Row9. In that case this will do.
    Please Login or Register  to view this content.
    And in your UserForm_Initialize event you could have something like this
    Please Login or Register  to view this content.
    to give you the next available Voucher number
    Last edited by bakerman2; 06-28-2025 at 09:09 PM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  9. #9
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Hi,
    Thank you all for your efforts..
    I have tried both the code it is working where there is data already there. When there is no data it gave error. I need in C2 it will mention 1001 starting when there is no data and in Textbox10 starting show 1001 for the first data and then 1002,1003 etc. Attached file for your reference.
    In addition I need the userform data will update in Data sheet as well as in Voucher sheet in the blank cells. Request you please look at this. I think i have explained well here.
    Attached Files Attached Files

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Type auto serial number started

    Please Login or Register  to view this content.

  11. #11
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Type auto serial number started

    Example file fully updated.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Dear Bakerman Sir superb like every time. This is exactly fulfilled my work. Just little bit help to alignment the data.
    In Receipt sheet all entries should be in left alignment. Here amount will show 1,00,000.00 for one lac and date when i will put 05-06-2025 it will update like 06-05-2025. Thats all. Thanks.

  13. #13
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Type auto serial number started

    I have zero experience with Indian curency so I've put several numerformats in the code. Up to you to choose 1 that suits you.
    Check out the rest of Receipt sheet to see if it suits you.
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Thanks again and exactly the same result what i needed. I will apply to my original file and if any query will come will let you know. Will revert soon. Same result of Indian currency format you had provided.

  15. #15
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Type auto serial number started

    Glad to help and good luck with your project.

  16. #16
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Dear Sir,
    In my userform i had done one small changes and added one combobox for payment mode and it will update the data but not work in refresh.
    Secondly i want to upload userform3 data to userform2 and again it will create issues due to Combobox.
    Request your help in this regard and attached file herewith.
    Attached Files Attached Files

  17. #17
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Type auto serial number started

    Think I covered it all.
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Bakerman Sir the code have tried and works superb. Many many thanks for your support time to time.

  19. #19
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Type auto serial number started

    Glad to help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  20. #20
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Dear Sir,
    I have added a macro to mention amount in words and in userform textbox 4 i need this code based of the userform3 amount changes. This i am trying and not getting to populate the textbox. This is my last query in this regard and request to help please.
    Attached Files Attached Files

  21. #21
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Hi,
    Please consider this attachment as in receipt sheet one code mentioned.
    Attached Files Attached Files

  22. #22
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Type auto serial number started

    I've made the change in Userform1 TextBox4.
    Attached Files Attached Files

  23. #23
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Bakerman Sir you are superb and help a lot. All the code is working fine and my issue here resolved. Thank you again.

  24. #24
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Type auto serial number started

    You're welcome.

  25. #25
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Sir sorry to trouble you again. Now i am getting error at the time of Upload data of Userform3.

    Please Login or Register  to view this content.
    Here the cursor showing error and Userform2 not showing. In your form it is working . I have copied the same form and contains to my data but still get error.
    Request you please explain what to do here.

  26. #26
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    242

    Re: Type auto serial number started

    Sorry it's my mistake and i have used other userform2 and i now just copied same your userform2 and works fine. Very sorry..

+ 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. Auto serial number with vba
    By satahir in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2022, 07:03 AM
  2. Auto Serial Number Using VBA
    By LoveCandle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-21-2022, 09:24 PM
  3. Auto generate serial number
    By Mahmoudelnemr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2019, 05:01 PM
  4. Auto Serial Number
    By sms1432 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-23-2017, 02:52 AM
  5. Auto Serial number
    By surya2384 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2016, 11:53 AM
  6. [SOLVED] Auto Populate Serial Number From Total number
    By sanju2323 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-04-2015, 04:33 PM
  7. Auto Serial Number
    By MdYas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-23-2014, 08:19 AM

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