Finding matching date.....

tdamme

New member
Local time
Today, 13:09
Joined
Jul 8, 2006
Messages
7
I am trying to find a match to a date that I paste into a spreadsheet. So then I run my data for July 5 and paste it in to a row that I am not using on the spreadsheet let's say ROW 60.... so my first piece of data in Row 60 column A is the date 5- Jul
Now where I am stuck ...... I want it to Activate the row that matches 5- Jul date in the same column A..... can anyone help.
 
Howdy can you attach a small sample?

And what do you mean by "activate"?
________
Cannabis seeds
 
Last edited:
I just need it to find or locate the same date in the spreadsheet....that is all i mean.....
 
Hi, tdamme,

the following code checks the date in column A and goes either to column B or C depending on my local time - each sheet only shows a month so at least the range has to be adjusted:

Code:
Private Sub Workbook_Open()
Dim datSearchDate As Date
Dim rngCell As Range
datSearchDate = Date
For Each rngCell In ActiveSheet.Range("A7:A37")
 If rngCell.Value = datSearchDate Then
  If Now > (datSearchDate + 0.5) Then
   Cells(rngCell.Row, 2).Select
   Exit For
  ElseIf Now > (datSearchDate) And Now < (datSearchDate + 0.5) Then
   Cells(rngCell.Row, 3).Select
   Exit For
  Else
    MsgBox "Date not found in active sheet"
  End If
 End If
Next
End Sub
Ciao,
Holger
 
Attached spreadsheet......

Maybe this is what you have shareed with me but I want to make sure ....


I have just pasted in the data on Line 60
Now I want it to find June 19 in the row above (Line 44)
And activate it so I can start pasting my data there.
Tomorrow I will have data for June 20 (in line 60) so I repeat the process but then I want it to find June 20 (line 45)
 

Attachments

Users who are viewing this thread

Back
Top Bottom