Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Glenn Duncan   on Dec 16 In MS Office Category.

  
Question Answered By: Latasha Wilson   on Dec 16

OK. Try changing:
Dim startDate As Date
to:
Dim startDate As Long

and changing;
startDate = CDate(InputBox("Please enter  Start Date: ", "STARTDATE"))
to:
startDate = DateValue(InputBox("Please enter start  Date:", STARTDATE"))

I'll take a guess that vlookup  doesn't like to handle the Date
variant; from excel help:
"Lookup_value can be a value, a reference, or a text string"

and include some more code to check for a valid date  input by the user.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Newbie VLOOKUP with dates question Or get search suggestion and latest updates.


Tagged: