sub column_delete()
dim x as workbook
dim sht1 as worksheet
dim currentColumn as integer
dim columnHeader as String
Set x = Workbooks.Open("Path to the file")
Set sht1 = x.Sheets("Page 1")
*For currentColumn = sht1.UsedRange.Columns.Count To 1 Step -1*
*columnHeader = shtl.UsedRange.Cells(1, currentColumn).Value*
Select Case columnHeader
Case "Date", "Time", "Header"
'Nothing'
Case Else
*shtl.Columns(currentColumn).Delete*
End Select
Next
End Sub
For all the above highlighted steps i am getting error as Run-time error ‘424’: Object required.
But i believe i have declared the required object. Sometimes, when i reopen excel the error goes and other time it appears.
Can you please help me with this issue.
P.S : I am a beginner in excel vba.

sht1(with an 'one') is not the same asshtl(with a 'L'). Always useOption Explicitat the start of module to see those annoying typos.