View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Error '1004' in WorksheetFunction

try this from anywhere in the workbook
Sub LookupVBA()
Dim contract As Integer
myrng = Sheets("sheet9").Range("E:I")
contract = InputBox("Enter NY Contract Number")
Flow = Application.VLookup(contract, myrng, 5, False)
MsgBox contract & "DA" & Flow
End Sub

--
Don Guillett
SalesAid Software

"oakman" wrote in message
...

Greetings to all,
First off, I would like to thank anyone who can help me. I appreciate
your effort and your time.
When I run the procedure below, I get a run-time error 1004 with the
following message "Unable to get the VLookup property of the
WorksheetFunction class".
I started by typing the code and then chose to use the pull down menu
for the property in hopes that this would fix the error. However, it
did not work.
I am greatful for any assistance.

Sub Get_NY_Contract()
Dim Contract As Variant
Dim Flow As Double

Contract = InputBox("Enter NY Contract Number")
Sheets(1).Activate
Flow = WorksheetFunction.VLookup _
(Contract, Range("E:I"), 5, False)

MsgBox Contract & "DA" & Flow
End Sub


--
oakman
------------------------------------------------------------------------
oakman's Profile:

http://www.excelforum.com/member.php...fo&userid=9172
View this thread: http://www.excelforum.com/showthread...hreadid=314369