Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ILX ILX is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Run Time 1004 Error: Application or Object Difine Error BEEJAY Excel Programming 0 October 17th 06 10:45 PM
Conditional Formatting - Run Time Error '13' Type Mismatch Error ksp Excel Programming 0 July 11th 06 07:06 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM


All times are GMT +1. The time now is 11:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"