cooper645
Well-known Member
- Joined
- Nov 16, 2013
- Messages
- 639
- Office Version
- 365
- Platform
- Windows
- MacOS
- Mobile
- Web
Hi guys,
I think I'm nearly there but can't seem to get it to do what I want.
I am trying to find the first instance of a date or date format in column headers, from left to right.
Here's the code I have managed so far, but it doesn't do as I need.
Any steer or help would be appreciated.
Thanks in advance.
Coops
I think I'm nearly there but can't seem to get it to do what I want.
I am trying to find the first instance of a date or date format in column headers, from left to right.
Here's the code I have managed so far, but it doesn't do as I need.
Code:
Sub InsertG1Dates()
Dim tbl As String
tbl = "_2018" 'Amend this to whatever the table name is
For i = 1 To 20
If ActiveSheet.ListObjects(1).HeaderRowRange(i).Value = Date Then
ActiveSheet.ListObjects(1).HeaderRowRange(i).Select
Else
End If
Next
End Sub
Any steer or help would be appreciated.
Thanks in advance.
Coops