Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run time error 9
I am running macros in a spreadsheet as part of a questionairre. As one of
my questions pops up, I type in a client name or I click on the tabs at the bottom and select a cell that should populate information in my spreadsheet. Now it is erroring out and will not let me complete all the steps. It appears that the current code with the error is as follows: 'Entering a repeat Customer 'Searches the customer db with a find command retry: enter2 = "" customer = Application.InputBox("Enter the client's company name.", ["Client"]) If customer = "" Then enter2 = MsgBox("You must enter the client's company name!", vbDefaultButton1, ["Client"]) If customer = "False" Then GoTo retry If enter2 = 1 Then GoTo retry With Workbooks("service request").Worksheets("customer").Range("b2:b500") Set C = .Find(customer, LookIn:=xlValues) If C Is Nothing Then GoTo retry End If If Not C Is Nothing Then firstaddress = C.Address End If End With If firstaddress = "" Then C.Address = ("b1") Workbooks("service request").Worksheets("customer").Activate Workbooks("service request").Worksheets("customer").Range(C.Address). Select The With Workbooks... is the line that seems to be high lighted everytime the debugger occurs. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run time error 9
Does this work?
With Workbooks("service request.xls").Worksheets("customer").Range("b2:b50 0") I inserted the .xls -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "ILX" wrote: I am running macros in a spreadsheet as part of a questionairre. As one of my questions pops up, I type in a client name or I click on the tabs at the bottom and select a cell that should populate information in my spreadsheet. Now it is erroring out and will not let me complete all the steps. It appears that the current code with the error is as follows: 'Entering a repeat Customer 'Searches the customer db with a find command retry: enter2 = "" customer = Application.InputBox("Enter the client's company name.", ["Client"]) If customer = "" Then enter2 = MsgBox("You must enter the client's company name!", vbDefaultButton1, ["Client"]) If customer = "False" Then GoTo retry If enter2 = 1 Then GoTo retry With Workbooks("service request").Worksheets("customer").Range("b2:b500") Set C = .Find(customer, LookIn:=xlValues) If C Is Nothing Then GoTo retry End If If Not C Is Nothing Then firstaddress = C.Address End If End With If firstaddress = "" Then C.Address = ("b1") Workbooks("service request").Worksheets("customer").Activate Workbooks("service request").Worksheets("customer").Range(C.Address). Select The With Workbooks... is the line that seems to be high lighted everytime the debugger occurs. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Run Time 1004 Error: Application or Object Difine Error | Excel Programming | |||
Conditional Formatting - Run Time Error '13' Type Mismatch Error | Excel Programming | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming |