Hi
I got this macro from someone else, but realised it does the complete opposite of what i want!
I want to only show the columns (so usually width of 64 pixels) and reduce the column width of everything else to 0![]()
Private Sub CommandButton100_Click() Dim n As Long For n = 2 To Range("B7").CurrentRegion.Columns.Count + 200 If InStr(Cells(7, n).Value, Range("H1").Value) >= 1 Then Cells(7, n).ColumnWidth = 0 End If Next n End Sub
This code reduces the column width of the cells i want to see to 0
My value is in cell H1 and if it says "kiwi" i want it to show all columns from b7 onwards horizontally that contain kiwi, again this does the opposite.
Hopefully someone could help me out?
Cheers
Dan
Bookmarks