Change your code to:![]()
Option Explicit Private Sub CommandButton100_Click() Dim n As Long Application.ScreenUpdating = False 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 = 8.43 Else Cells(7, n).ColumnWidth = 0 End If Next n Application.ScreenUpdating = True End Sub
Bookmarks