Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Function to return column where a date is entered

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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



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
Adding entries if date entered in another column Jen Excel Worksheet Functions 6 February 17th 09 07:23 PM
Value entered automatically on lookup of date in column junoon Excel Programming 0 May 31st 06 12:36 AM
Enter date in column L if value is entered in column B Mikus Excel Programming 1 September 3rd 05 10:20 PM
Return Days since Date Entered in Column. Mcasteel[_51_] Excel Programming 0 November 18th 04 04:24 PM
Return Days since Date Entered in Column. Mcasteel[_50_] Excel Programming 3 November 18th 04 04:23 PM


All times are GMT +1. The time now is 12:20 PM.

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"