Hello Forumreaders,
Can someone help me with a code that hide every columns that does not confirm to the cell value in a row 5 for example.
I have a code that deletes all columns, but I have to hide these columns and not delete them.
With regards,
FvdF
![]()
Public Sub DeleteColumns() Dim Counter As Long Application.ScreenUpdating = False For Counter = ActiveSheet.UsedRange.Columns.Count To 1 Step -1 Select Case Cells(5, Counter).Value Case "1" Case "LBO1" Case "LDN1" Case "GHI1" Case "HAA1" Case "IJC1" Case "KEN1" Case "ZAA1" Case "WAT1" Case Else ActiveSheet.Columns(Counter).Delete End Select Next Counter End Sub
Bookmarks