Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jacob,
Thank You, that did the job. It'll make life easier. Kevin. "Jacob Skaria" wrote: Try this version.. Sub Macro2() Dim varDate As Variant, varFound As Variant varDate = InputBox("Enter Date to be searched") If IsDate(varDate) Then Set varFound = Columns(1).Find(CDate(varDate), _ LookIn:=xlValues, Lookat:=xlWhole) If Not varFound Is Nothing Then varFound.Activate Else MsgBox "Date not found" End If Else MsgBox "Invalid Date" End If End Sub -- Jacob (MVP - Excel) "Kev - Radio Man" wrote: Sub Macro2() Dim varDate As Variant, varFound As Variant varDate = InputBox("Enter Date to be searched") If IsDate(varDate) Then Set varFound = Columns(1).Find(varDate, LookIn:=xlValues, Lookat:=xlWhole) If Not varFound Is Nothing Then varFound.Activate Else MsgBox "Date not found" End If Else MsgBox "Invalid Date" End If End Sub Jacob, Thanks for that, it does work, but my mistake, I meant to say that when the date is entered it goes to that date (row) in that sheet if found, else produce an error message. Your code does do as it asks, says "Yes" the date exsists. Sorry for my mis-explaination of what I was trying to do. Your help is most grateful. Kevin. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro to find data from one sheet & copy in another sheet | Excel Programming | |||
Formula in one sheet to find first occurrence of date in another | Excel Programming | |||
Goto or Find a Date in a Sheet | Excel Discussion (Misc queries) | |||
Macro to find matching date and copy values to another sheet | Excel Discussion (Misc queries) | |||
find date on other sheet | Excel Programming |