Sub delete_column_headers_based_on_column_headers()
For i = 1 To 100
col_names = Array("EMPLOYEEID", "EMPLOYEENAME", "EMPLOYEECOMPANY")
col_name = ThisWorkbook.Sheets("sheet1").Cells(1, i).Value
If col_name <> "" Then
If (col_name <> col_names(0) And col_name <> col_names(1) And col_name <> col_names(2)) Then
ThisWorkbook.Sheets("sheet1").Cells(1, i).EntireColumn.Delete
i = i - 1
End If
End If
Next i
End Sub
VBA Outlook KPI Excel Alt+F11 Dashboards Macros Recording Graphs Automation Developer WaterFall Powerpoint Charts Pivot Tables Forecast Charts