I want to create a list of column names and match it with the columns existing in the sheets. If the column name does not match up with the list of columns, I have to delete it. So far from what I've researched, they're only giving one column name only. I've been stuck up with this part. Option Explicit
Sub Sample()
Dim strSearch As String
Dim aCell As Range
strSearch = "Salary" 'I want to have a list of column names here
Set aCell = Sheet1.Rows(1).Find(What:=strSearch, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
'if the column name does not match, then the entire column should be deleted
End Sub
Any help?