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
Bookmarks