+ Reply to Thread
Results 1 to 7 of 7

Add userform data into first empty row on sheet

  1. #1
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Add userform data into first empty row on sheet

    I am looking for some code that I can add to a command button on my userform that will do the following:
    Find the first empty row in column C on the sheet 'EquipmentData'. On that row add the data from the userform in the drop down box called RentalHouse into column A, text box SerialNumber into column B, and text box ItemDescription into column C.

    Thanks,
    James

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Add userform data into first empty row on sheet

    Hi James

    Can you post your spreadsheet for me?

    I would avoid nameing your textboxes in future.

    I have a userform with 64 textboxes. I use a loops to read them and write them. 4 lines each.

  3. #3
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Add userform data into first empty row on sheet

    The form is called NewItem. Spreadsheet is attached.
    Thank you for your time.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Add userform data into first empty row on sheet

    Hi

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Add userform data into first empty row on sheet

    I used the second set of code since I dont want to go to the EquipmentData sheet. At first it appeared to work correctly when I was already viewing the EquipmentData sheet. However when i ran the user form when not viewing the EquipmentData sheet, it did not enter the data into the first empty row at the bottom, it appeared to randomly write the data over other records. There is a total of about 1700 records. The first time I did it it put the data on record 1498, the second time it put it on record 6, and the third time it put in on record number 42.
    I have attached my spreadsheet.
    (run the user form NewItem, enter data into the three boxes and click Add & Exit)
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Add userform data into first empty row on sheet

    Your Spreadsheet is too complex for me to see what you are doing.

    Try this ammendment:-

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 12-14-2013 at 10:05 PM.

  7. #7
    Forum Contributor
    Join Date
    09-16-2013
    Location
    Los Angeles, USA
    MS-Off Ver
    Excel 2011
    Posts
    620

    Re: Add userform data into first empty row on sheet

    That workbook returns the same results I was getting. If you view say the ReturnData sheet then run Macro1 it enters the data into a random row on EquipmentData (not the last empty row). However if you run the macro while the EquipmentData sheet is viewed then it works fine.

+ 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] Code to place userform data into next empty row
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-11-2013, 01:06 PM
  2. [SOLVED] not finding first empty row in sheet from userform
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2013, 12:37 PM
  3. [SOLVED] Userform to add data into next empty row
    By andywsw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2012, 10:10 PM
  4. Userform - always add data to next available empty row
    By D_N_L in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2012, 03:54 AM
  5. Transfer Userform Data to next empty Row
    By Mrs. Robinson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2010, 04:24 PM

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