+ Reply to Thread
Results 1 to 6 of 6

UserForm autonumber

  1. #1
    Registered User
    Join Date
    08-18-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    UserForm autonumber

    Hi all,
    I have a UserForm which submits data to another worksheet; it also specifies an autonumber for each new record, however I have some code which finds the fist empty cell and the two donít work together well.

    The code makes a number appear in cell A1 but places the UserForm data underneath it in A2

    Is it possible to amend the code allow the auto number to appear in A1 and UserForm data to appear in B1

    Here is the code:

    Please Login or Register  to view this content.
    Many thanks,

    Adele
    Last edited by adeleex; 08-23-2011 at 09:15 AM.

  2. #2
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: UserForm autonumber

    just remove the offset from the lRow line:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: UserForm autonumber

    Your code will come unstuck if the data is sorted differently

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    08-18-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: UserForm autonumber

    mohd9876, I removed the offset from the lRow line and now when I enter data it just removes the auto number completely and puts the data into cell A1?

    royUK I tried this instead and got a host of errors! (my coding skill are terrible tho!!)
    Last edited by adeleex; 08-23-2011 at 08:34 AM.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,646

    Re: UserForm autonumber

    this suffices:


    Please Login or Register  to view this content.
    Last edited by snb; 08-23-2011 at 09:07 AM.



  6. #6
    Registered User
    Join Date
    08-18-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: UserForm autonumber

    snb, works great!!! xx

+ 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