Welcome to the forum

1. I added CODE tags around your macro - you can use the [#] icon on the toolbar and paste your macro between

2. I couldn't follow your macro, but going by the description, something like this would be faster, although if the hidden columns have formulas, they'd still be calculated even if hidden

3. There a few minor tweaks that might improve performance, but the increase in complexity didn't seem worth it

4. I assumed that the X's would be in L3 to the last row 3 column that has any data in it


Option Explicit

Sub HideColumns()

Dim maxCol As Long, iCol As Long

'Application.Calculation = xlCalculationManual
'Application.ScreenUpdating = False

With ActiveSheet
    
    maxCol = .Cells(3, .Columns.Count).End(xlToLeft).Column
    
    For iCol = 12 To maxCol
        If .Cells(3, iCol).Value = "X" Then
            .Columns(iCol).Hidden = True
        End If
    Next iCol
End With

'Application.Calculation = xlCalculationAutomatic
'Application.ScreenUpdating = True

End Sub