|
-
Aug 6th, 2003, 10:33 AM
#1
Thread Starter
Fanatic Member
Search a row of dates
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
He who listens well, speaks well.
-
Aug 7th, 2003, 03:13 AM
#2
One way is to have a text box that you enter the date you're searching for and then use something like...
Code:
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
-
Aug 22nd, 2003, 03:06 AM
#3
Frenzied Member
How about a loop....
VB Code:
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....
-
Aug 25th, 2003, 05:08 PM
#4
Addicted Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|