View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Help - Need a Macro/Popup to Find a Date in a Sheet.

Try th ebelow

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 (MVP - Excel)


"Kev - Radio Man" wrote:

Hi,

I have a sheet with the date down in column A.
I made a macro up (thought I had) to find a date, click on the command
button, brings up a feild box to enter a date and then goto the date in
column A.
However it did not work.
I am using 2007 now so my dates go on and on now.

Is there any easy an dpresentable way to do this in code?

Thanks Kevin.