I have an excel file in which I would like delete columns that aren't useful.
Say I have 4 columns: 'ID', 'Name', 'Surname', 'Job'. What I'm trying to do is delete all columns that aren't 'ID' and 'Job'.
I tried using the Range.Find method, but there's obviously something I'm getting wrong.
Any help appreciated
myArray = Array("ID", "Job")
'Delete columns which title aren't in myArray
For j = mycol To 1 Step -1 'col by col
For k = 0 To 4 'for each element in myArray
' Delete col where no elements of myArray are present.
Columns(j).Delete
Next k
Next j
EDIT: By columns names, I mean the first row of each column. So A1=ID, B1=Name etc.