+ Reply to Thread
Results 1 to 10 of 10

Autonumber within VBA Userform, not via formula

  1. #1
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Autonumber within VBA Userform, not via formula

    I'm really looking for an autonumber method that works within a userform rather than using a formula on a sheet where the data would go. Someone helped me with the formula version but for the users purposes, the autonumber must be userform driven. Since none of it is dependent upon my code, I haven't posted any but let me know if it is indeed needed.

    Any ideas?

    Thanks in advance for any help. My last post died so I'm trying to break up the issues I had into seperate posts.
    -Orestees

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Autonumber within VBA Userform, not via formula

    if the range will have only A number you can get the max number and add 1 to it

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Re: Autonumber within VBA Userform, not via formula

    Where should this code be placed to work? I tried in creating a hidden TextBox and used the code there, but I'm sure I'm wrong. Also tried within the Finalize Sub to no avail.

    Sorry, I'm a beginner at code in general. Thanks again for the help!

  4. #4
    Registered User
    Join Date
    05-28-2012
    Location
    Pittsburgh, Pa
    MS-Off Ver
    Excel 2003 - 2007 -2010
    Posts
    49

    Re: Autonumber within VBA Userform, not via formula

    Without actually seeing your sheet, I would say the code example given by mike7952 would go in the userform open event.

    Maybe post your sheet?

    cplmckenzie

  5. #5
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Re: Autonumber within VBA Userform, not via formula

    Example Autonumber (Broken).xlsm

    I tried in the initialize event but nothing changed. I've attached the example I'm using and really appreciate the help. This project is almost done so these little pieces matter more at this point.

    Thanks again in advance!

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Autonumber within VBA Userform, not via formula

    I would put it into your Finalize_Click() Event

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Re: Autonumber within VBA Userform, not via formula

    I tried adding the code in but nothing changed. I also tried again with adding numbers for the prior entries but that didn't help either.

    Thanks for sticking with me here.

  8. #8
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Autonumber within VBA Userform, not via formula


  9. #9
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Re: Autonumber within VBA Userform, not via formula

    Thanks a ton Mike, that works perfectly!! This is a huge help.

    I really appreciate your patience with me!

    Cheers

  10. #10
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Autonumber within VBA Userform, not via formula

    Your welcome

+ 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