OilEconomist
Active Member
- Joined
- Dec 26, 2016
- Messages
- 439
- Office Version
- 2019
- Platform
- Windows
Thanks in advance and I will post feedback for proposed solutions.
Here is my code thus far.
For the date located in cell A5 of sheet "Sheet1", I am trying to find the corresponding column number/cell address within Row 3 of "Sheet2" with that same date.
The date in cell A5 of "Sheet1" is a hard coded value with the format "4/1/2019".
The dates in Row 3 of "Sheet2" are formulas after the first date entered.
Here is my code thus far.
Code:
Sub FindDate2()
Dim DT As Date, VR As Variant, CL As Long
DT = Sheets("Sheet1").CDate(Cells(5, 1))
Set VR = Sheets("Sheets").Range("3:3").Find(DT, , , xlWhole)
If Not DT Is Nothing Then
CL = DT.Column
Else
Exit Sub
End If
End Sub
The date in cell A5 of "Sheet1" is a hard coded value with the format "4/1/2019".
The dates in Row 3 of "Sheet2" are formulas after the first date entered.