View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Function to return column where a date is entered

If you are passing a worksheet from the spreadsheet to VBA its best to pass
the string name. try this code

Function FindDateColumn(myWS As String, myDate As Date)

Worksheets(myWS).Select
FindDateColumn = _
Selection.Find(what:=myDate, LookIn:=xlValues)

End Function


"Barb Reinhardt" wrote:

I'd like to have a function something like this:

Function FindDateColumn(myWS as worksheet, myDate as Date)

I want to find the first (and probably only entry) of a specific date on a
worksheet and return the date column. I can't seem to get it to return
anything. I'd show my code, but unfortunately, it's at work and I"m not.
It seems to be format specific somehow. Can someone help?

Thanks,
Barb Reinhardt