Thread: Lookup Macro
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Lookup Macro

there is no xlLookAt:= named argument. The argument name is Lookat:=


for you other question:

Dim res as Variant
res = Application.LOOKUP(LEFT(Range("D5"),3), _
Range("HTC!A2:A200"),Range("HTC!B2:B200"))
if not iserror(res) then
msgbox res
else
msgbox "Not found"
End if

--
Regards,
Tom Ogilvy


"Dthmtlgod" wrote in message
...
Thanks Chris,

I am receiving an error on this.
Run Time Error 448:
Named Argument Not Found

It errors out on the Set R line.

Z = 5
Do While Range("DCI!A" & Z).Value = Date
If Range("DCI!J" & Z).Value = 0 Then
Set R = Worksheets("HTC").Columns(2).Find(Left(Range("DCI! D" & Z).Value,

3),
XlLookAt:=xlWhole)
Range("DCI!J" & Z).Value = R.Value
End If
Z = Z + 1
Loop



"chris: Put 'Set' in front of 'x'"
wrote in message

...
Dim x As Range
Set x = Worksheets("Sheet2").Columns(2).Find...