The code hides all unneeded columns except for the columns that need viewed. Dates are in row 3. The user selects the Date From dropdown in cell "H3". VBA then loops through the columns and hides all cloumns except for the selected columns. The Code runs good; however, it takes almost a minute to complete. Is there a way to speed up the process? Would Dictionary object work? I know about Dictionary Object but have not learned how to use it yet.
VBA Code:
Sub OrderView()
Cells.EntireColumn.Hidden = False
If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData
For Each c In Range("T3:ADM3").Cells
If (c.Value <> Range("H3")) And (c.Value <> Range("I2")) Then
c.EntireColumn.Hidden = True
End If
Next c
Range("A:B,H:L,P:P,Q:Q,R:R,S:S").EntireColumn.Hidden = True
End Sub