+ Reply to Thread
Results 1 to 6 of 6

Auto Number a userform text box then add to spreadsheet

  1. #1
    Registered User
    Join Date
    01-04-2014
    Location
    hartlepool England
    MS-Off Ver
    Excel 2007
    Posts
    15

    Auto Number a userform text box then add to spreadsheet

    Hi

    I am new to VBA and am struggling to work out how to add a Auto number to a user form Textbox then add the information from the User form to my spread sheet.

    This is the VBA code I am using at the moment:

    Please Login or Register  to view this content.
    What I require is for textbox1 to have a auto number starting with PR then a consecutive number.

    Thanks in advance

    Citrix
    Last edited by FDibbins; 08-20-2016 at 01:03 AM.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Auto Number a userform text box then add to spreadsheet

    Please use codetags when posting code!

    Autonumber based on what?
    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.

  3. #3
    Registered User
    Join Date
    01-04-2014
    Location
    hartlepool England
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Auto Number a userform text box then add to spreadsheet

    In column A:1 I have a number e.g PR 8004 and when I open the user form would like text box 1 on my user form to auto number to e.g PR 8005 (next consecutive number and so on.

    Thanks

  4. #4
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: Auto Number a userform text box then add to spreadsheet

    Try:
    Please Login or Register  to view this content.
    Last edited by abduljaleel.mca; 08-19-2016 at 02:07 PM.

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Auto Number a userform text box then add to spreadsheet

    This will do the trick.
    Please Login or Register  to view this content.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Auto Number a userform text box then add to spreadsheet

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (I have added them for you - this time )
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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] Userform - Auto populate multiple option button captions from spreadsheet
    By trixmaster in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-13-2016, 07:06 PM
  2. find text in listbox on userform, delete row containing that text on spreadsheet
    By tsiguy96 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-09-2016, 03:11 AM
  3. Auto-Number for PO spreadsheet
    By sdjames1979 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-20-2015, 10:28 AM
  4. [SOLVED] Userform: How do I use text/values from a spreadsheet to customize the userform?
    By bananajelly in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2014, 03:47 PM
  5. how to create auto number in vba userform?
    By latra23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2013, 03:16 PM
  6. auto fill a spreadsheet on a userform based on a textbox value
    By cyclone77 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2012, 11:38 PM
  7. help with auto number on userform
    By leeagall in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-08-2010, 07:52 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