Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to add a user via an UserForm. I've been using this code for
ComboBoxes but it errors out for my textbox. When it runs, the error message is "Run-time error '1004': Method 'Range' of object '_Worksheet' failed" The debugger points to this line Sheet2.Range("H" & found).Value = UserForm1.TextBox9.Value I can't find out why 'found' doesn't have a value. Any thoughts. The full code is below. Private Sub CommandButton12_Click() 'Add new user test_row = 2 test_value = Sheet2.Range("H" & test_row).Value While test_value < "" If test_value = UserForm1.TextBox9.Value Then found = test_row GoTo leaveloop1 End If test_row = test_row + 1 test_value = Sheet2.Range("H" & test_row).Value Wend leaveloop1: Sheet2.Range("H" & found).Value = UserForm1.TextBox9.Value ComboBoxRefresh End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
multiple user in excel to edit a userform | Excel Discussion (Misc queries) | |||
Userform doesn't recognize other user form upon re-load | Excel Programming | |||
How to keep the Checkboxes selected by the user unchanged even after closing the userform | Excel Programming | |||
How to keep a Userform available while the user interacts with a spreadsheet | Excel Programming | |||
How to get User input from Userform Text box | Excel Programming |