Hello currently I'm trying to export data from a workbook without open it by using macro, to explore the limits of VBA I'm trying to check if some specific headers are present on the sheet.
Exemple code :
The code works perfectly but in my actual sheet I have two header which are "DATE" and "DATE linked" both start with DATE, the problem is that the code select "DATE linked" column instead of "DATE".
I need some help to solve this problem.
In the same way I have a request, I is possible to check a list of Headers directly in on sub without creating specific subs, like for headers ("DATE", "TIME", "ID", "NAME") so I can inform the user If all the data are on the sheet or not.
I hope you understand my problem.
Exemple code :
VBA Code:
Sub Checking()
Dim Cell_Date As Range
Set Cell_Date = Range("A5:CJ5").Find("DATE")
If Cell_Date Is Nothing Then
MsgBox "The header Is not their"
Exit Sub
End If
Range(Cell_Date, Cell_Date.End(xlDown)).Select
End Sub
The code works perfectly but in my actual sheet I have two header which are "DATE" and "DATE linked" both start with DATE, the problem is that the code select "DATE linked" column instead of "DATE".
I need some help to solve this problem.
In the same way I have a request, I is possible to check a list of Headers directly in on sub without creating specific subs, like for headers ("DATE", "TIME", "ID", "NAME") so I can inform the user If all the data are on the sheet or not.
I hope you understand my problem.