Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Runtime error '1004'

Error message given is "Unable to get the Vlookup property of the
WorksheetFunction class"

I have a Combobox that selects an item in a list, this item is selected then
I receive the error message.

Help please.

Thanks
Dean


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Runtime error '1004'

Entries in a combobox are strings, so it sounds like Vlookup can't find the
match (a string won't match a date)

Dim results as Variant
results = Application.Vlookup(cDate(combobox1.Value),
Range("Sheet5!A1:F365"),4,False)
if iserror(results) then
msgbox combobox1.Value & " was not found"
else
msgbox results " is the result"
End if

--
Regards,
Tom Ogilvy

"Dkso" wrote in message
...
Error message given is "Unable to get the Vlookup property of the
WorksheetFunction class"

I have a Combobox that selects an item in a list, this item is selected

then
I receive the error message.

Help please.

Thanks
Dean




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Runtime error '1004'

Can I do a search for a date, I eventually want to create a diary, list
of dates where I can find the date and put entries into the cell next
to it.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Runtime error '1004'

Sure, but if that is what you are doing, it might be easier to use an
autofilter under the data menu. Anyway, one way would be:

Private Sub Combobox1_click()
Dim results as Variant
Dim rng as Range
' diary range with dates
Set rng = worksheets("Sheet1").Range("A1:A2000")
results = Application.Match(clng(cDate(combobox1.Value)), _
rng,0)
if iserror(results) then
msgbox combobox1.Value & " was not found"
else
Worksheets("Sheet1").Select
rng(results).Select
End if
End Sub
--
Regards,
Tom Ogilvy

"Dean" wrote in message
ups.com...
Can I do a search for a date, I eventually want to create a diary, list
of dates where I can find the date and put entries into the cell next
to it.



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
What causes runtime error 1004? [email protected] Excel Discussion (Misc queries) 4 October 27th 05 07:15 PM
Another runtime 1004 error [email protected] Excel Discussion (Misc queries) 2 September 17th 05 09:21 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Runtime error '1004': Capinvest Excel Programming 2 August 4th 03 07:16 PM
runtime error 1004 Adella Excel Programming 2 July 29th 03 08:07 PM


All times are GMT +1. The time now is 07:39 AM.

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

About Us

"It's about Microsoft Excel"