+ Reply to Thread
Results 1 to 4 of 4

Auto increment number when posting data from form to workscheet.

  1. #1
    Registered User
    Join Date
    01-22-2016
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    2

    Auto increment number when posting data from form to workscheet.

    Hello everyone,

    I am trying to make a workbook that when ppl fill in a form, the data goes to the workscheet. I have 2 textboxes that can be filled in.
    The rest of the data thats filled in comes true the vba code of the form. Like the users name, datestamp,...
    The first line on the sheet has to be a number. like A2=001 A3=002 ....
    So i want to be able to code the number in my code so it takes the higher number +1.
    When i try to do this the number stays 1 in every row.
    This is what i tryed already:

    RowCount = Worksheets("Blad1").Range("A1").CurrentRegion.Rows.Count
    With Worksheets("Blad1").Range("A1")
    .Offset(RowCount, 1).Value = Me.cmbVerantwoordelijke.Value
    .Offset(RowCount, 0).Value = Range("A2").Value + "1"
    ' .Offset(RowCount, 0).Value = Row("A3") + "1"
    '.Offset(RowCount, 0).Value = Row("-1, 0") + 1
    ' .Offset(RowCount, 1).Value = Application.UserName

    The data projection from form in worksheet goes with .Offset (RowCount).

    Can someone tell me how to perform this step?
    Thx in advance,

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Auto increment number when posting data from form to workscheet.

    I would use
    Please Login or Register  to view this content.
    to obtain the highest number currently in column A and then increment it
    If someone has helped you then please add to their Reputation

  3. #3
    Registered User
    Join Date
    01-22-2016
    Location
    Belgium
    MS-Off Ver
    2010
    Posts
    2

    Re: Auto increment number when posting data from form to workscheet.

    Quote Originally Posted by pjwhitfield View Post
    I would use
    Please Login or Register  to view this content.
    to obtain the highest number currently in column A and then increment it
    Thx for the answer. I just tested it and like that it doesnt work. But when i try: .Offset(RowCount, 0).Value = WorksheetFunction.Max(Range("A:A")) + 1 it works!

    So many thx for giving me a direction mate. I am new @ exel but i do program for android and stuff. I like the possibilities you have with exel ☺.
    Gone stay at this site and explorer more and give help if i can -

  4. #4
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Auto increment number when posting data from form to workscheet.

    VBA is a great language I think, the possibilities are endless especially if you're happy to just play around and try new things.

+ 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. Macro to auto increment number
    By asianqueen in forum Excel General
    Replies: 2
    Last Post: 07-13-2015, 07:28 PM
  2. Replies: 8
    Last Post: 04-06-2015, 11:44 AM
  3. Excel 2010 - Userform - Vlookup, Alpha Numeric auto increment, send form to Outlook
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2015, 05:54 AM
  4. auto increment number with date
    By m_k in forum Excel General
    Replies: 6
    Last Post: 03-17-2012, 09:33 AM
  5. Excel number auto increment help!
    By Talmac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2010, 04:52 AM
  6. Generate auto increment number from VB form
    By john_t_h in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2005, 06:19 PM
  7. Auto Increment for Form Number...NEWBY
    By piranhagirl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2005, 10:02 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