I need help with my userform.
I have a userform that users can input data for a report. The problem I have is that every time the Input form is called, it is empty. I need the ability to edit input that has already be entered. I want to keep the ability to enter new input onto a blank userform (dialog box) as well as fill the userform based on the information that is currently in the spreadsheet.
Here's my code:
The above code gives me an 'object required' error.
gives a 'Object variable or With block variable not set'.
And, finally,
Gives me an 'Invalid use of property' compile error.
Also, if there is an easier way to accomplish this, let me know.
Right now I have written a "new input" macro (blank userfrom) and am working on the above "edit input" macro. (I realize it's easier to just change a few input on the spreadsheet, but other people in my department have asked to also be able to edit info in the userform.)
Thanks for the help.
I have a userform that users can input data for a report. The problem I have is that every time the Input form is called, it is empty. I need the ability to edit input that has already be entered. I want to keep the ability to enter new input onto a blank userform (dialog box) as well as fill the userform based on the information that is currently in the spreadsheet.
Here's my code:
Code:
Sub Edit_EInput_Form()
'Allows use to edit input using dialog box.
Worksheets("Input").Select
Dim UW_Combo As Object
Set UW_Combo = Range("E14").Text
'More code to set the other variables here.
Input_Form.Show
End Sub
The above code gives me an 'object required' error.
Code:
Sub Edit_EInput_Form()
'Allows use to edit input using dialog box.
Worksheets("Input").Select
Dim UW_Combo As Object
Set UW_Combo = UW_Combo
UW_Combo.Text = Range("E14").Text
'More code to set the other variables here.
Input_Form.Show
End Sub
gives a 'Object variable or With block variable not set'.
And, finally,
Code:
Sub Edit_EInput_Form()
'Allows use to edit input using dialog box.
Worksheets("Input").Select
Dim UW_Combo As ComboBox
Set UW_Combo.Text = Range("E14").Text
'More code to set the other variables here.
Input_Form.Show
End Sub
Gives me an 'Invalid use of property' compile error.
Also, if there is an easier way to accomplish this, let me know.
Right now I have written a "new input" macro (blank userfrom) and am working on the above "edit input" macro. (I realize it's easier to just change a few input on the spreadsheet, but other people in my department have asked to also be able to edit info in the userform.)
Thanks for the help.