grunschlange
New Member
- Joined
- Sep 12, 2009
- Messages
- 13
Hello.
I have the following code that keeps giving me an "object variable or With block variable not set" error:
Sub test12()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim x As String
x = InputBox(Prompt:="Enter the Web ID.", Title:="ID Input")
Windows("Intake-November-11.xls").Activate
Sheets(1).Select
Cells.Find(What:=x).Select
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
I am trying to run this from a worker workbook called "Simon-November-11" in a sheet-level macro. It is in a sheet-level module because "Simon" and the other worker workbooks are created from the master "Intake" workbook, and I need to have some macros available for the workers to enter ID numbers to get cases to work from the master file. The first part of my project is entering an ID# and having a macro find the cell with that #. Later, I will copy parts of the row with the # and paste them in the worker file.
The problem I am having is that every time I test this, I get the "object variable" error. Can you help me understand what I am missing? I have searched several examples and can't seem to find a good solution.
Let me know if you need more information for this.
Thanks.
I have the following code that keeps giving me an "object variable or With block variable not set" error:
Sub test12()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim x As String
x = InputBox(Prompt:="Enter the Web ID.", Title:="ID Input")
Windows("Intake-November-11.xls").Activate
Sheets(1).Select
Cells.Find(What:=x).Select
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
I am trying to run this from a worker workbook called "Simon-November-11" in a sheet-level macro. It is in a sheet-level module because "Simon" and the other worker workbooks are created from the master "Intake" workbook, and I need to have some macros available for the workers to enter ID numbers to get cases to work from the master file. The first part of my project is entering an ID# and having a macro find the cell with that #. Later, I will copy parts of the row with the # and paste them in the worker file.
The problem I am having is that every time I test this, I get the "object variable" error. Can you help me understand what I am missing? I have searched several examples and can't seem to find a good solution.
Let me know if you need more information for this.
Thanks.