I found out the same after commenting out. Instead out directly go for msg box.
The below code is very fast if we have 50k rows.
The code uses Filter object and its Property
sht.AutoFilter.Filters.Item.Criteria1
Sub MessageFilterValuess()
Dim sht As Worksheet
Dim f As Long
Dim i As Long
Dim ItemCount As Long
Dim ItemStr As Variant
Dim Msg As Variant
Dim currentFiltRange As Variant
Set sht = ActiveSheet
Msg = ""
sht.[A1].Select
With sht.AutoFilter
currentFiltRange = .Range.Address
With .Filters
For f = 1 To .Count
With .Item(f)
If .On Then
Msg = Msg & Cells(1, f).Address(0, 0) _
'& ": " & ValA & " " & ValB & " (" & ValC & ")" & vbLf
End If
End With
Next f
End With
End With
If Msg = "" Then Msg = "No columns filtered"
MsgBox Prompt:=Msg, Title:="Filtered Columns"
End Sub