Results 1 to 5 of 5

Userform not saving to next empty row on spreadsheet

Threaded View

  1. #1
    Registered User
    Join Date
    07-29-2016
    Location
    dallas, tx
    MS-Off Ver
    365
    Posts
    51

    Userform not saving to next empty row on spreadsheet

    I've had my userform up and running error free for several months now, but I have discovered a problem that hadn't presented itself earlier. My coworkers have been using this form, which saves to 41 columns on the spreadsheet. Never has just one field on the userform been completed and then saved. There's always been multiple fields completed on the userform and then saved successfully to the next empty row.

    What I noticed today is that if I complete only one field and then save, it will save over itself on the same row on the worksheet repeatedly. This only applies to all the fields except the one that is saved to Column 1. I can complete that first field only (saved to Column 1) on the userform and hit the command button to save and enter a new userform and it will save each time to the next empty row. However, if I completed, as an example, the field that is to be saved to Column 5 and no other field on the user form it will keep replacing the text in Column 5 on the same row. I've looked at so many sites for answers and it appears my code is right, but obviously it's not and I just can't see what the problem is.

    Here is a sample of my code:

    Private Sub CLOSEFORMcmd_Click()
    erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    Cells(erow, 1) = STAFFcombo.Text
    Cells(erow, 2) = CONTACTDATEtxt.Text
    Cells(erow, 3) = HOWCONTACTcombo.Text
    Cells(erow, 4) = RESPONSEDATEtxt.Text
    Cells(erow, 5) = TYPERESPONSEcombo.Text
    
    Unload Me
    
    End Sub
    Last edited by katiedee1625; 01-30-2017 at 10:56 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Saving data from UserForm to spreadsheet
    By katiedee1625 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2016, 11:35 AM
  2. [SOLVED] Cell w/link formula to show as empty for VBA check before saving
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2014, 04:30 PM
  3. [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
  4. Replies: 3
    Last Post: 08-20-2013, 04:19 PM
  5. Saving excel spreadsheet via userform
    By kieranbop in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-13-2011, 09:34 AM
  6. Saving to text file - tabs from empty cells ignored
    By lif in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2006, 11:51 AM
  7. Saving a spreadsheet without saving the Macro
    By tedd13 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-31-2006, 09:20 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