Click to See Complete Forum and Search --> : Search a row of dates
JCScoobyRS
Aug 6th, 2003, 10:33 AM
I have a row of dates and I need to be able to search it for a value and when that value is encountered, I need to get the cell in which the value was found. Can someone help? Thanks, Jeremy
lintz
Aug 7th, 2003, 03:13 AM
One way is to have a text box that you enter the date you're searching for and then use something like...
Dim CurrentRow As Interger
oXLApp.Worksheets("Sheet1").Select
objExcel.Range("A1").Select
Do Until objExcel.ActiveCell.Value = Text1
objExcel.ActiveCell.Offset(1, 0).Select
Loop
CurrentRow = objExcel.ActiveCell.Row
Spajeoly
Aug 22nd, 2003, 03:06 AM
How about a loop....
For i = 1 To 100 'Or whatever...
If InStr(1, Range("$A$" & i).Value, Date) Then
Range("$A$" & i).Select
Exit For
End If
Next
Just a thought, untested code btw....:D
adocwra
Aug 25th, 2003, 05:08 PM
Public Sub datefind()
Dim sCell As Range
For Each sCell In Selection
If IsDate(sCell.Value) Then MsgBox (sCell.Value) ' STORE IN ARRAY OR PLACE ON SPREAD
Next
End Sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.