View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
KyWilde KyWilde is offline
external usenet poster
 
Posts: 15
Default Using variables to make a date and using find method to find t

Thank you Toppers...!!!

"Toppers" wrote:


Your string in quotes was treated as literally a string "mon1/day1/year1"
and not as variables concatenated with "/".

Use:

Set rngFound = rngSearch.Find(mon1 & "/ " & day1 & "/ " & year1)

HTH

"KyWilde" wrote:

I have the month in a variable "mon1", the day in a variable "day1" , and the
year in a variable "year1". I need to use the find method to find this
specific date and here is the code I am using...
Set wks = ActiveSheet
Set rngSearch = wks.Cells
Set rngFound = rngSearch.Find("mon1 / day1 / year1")
Debug.Print rngFound.Address

This doesn't work. But if I use "4/1/2005" in place of the variables it
works just fine. What do I need to do to make this work? Thanks!!