Run time error 9

I

ILX

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.
 
W

Wigi

Does this work?

With Workbooks("service request.xls").Worksheets("customer").Range("b2:b500")

I inserted the .xls
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top