Senso
Inventaris
- Lid geworden
- 13 jun 2016
- Berichten
- 12.087
- Besturingssysteem
- W11 Pro 25H2
- Office versie
- Office 2007 H&S en Office 2021 Prof Plus
Het zijn kolommen in tabelvorm
met
kolom1
daaronder
Naam
zo elke kolom
Wat is niet goed aan de code?
met
kolom1
daaronder
Naam
zo elke kolom
Wat is niet goed aan de code?
PHP:
Sub HideColumnsWithOnlyHeaders()
Dim col As Range
Application.ScreenUpdating = False
For Each col In ActiveSheet.UsedRange.Columns
' If CountA is 1 or 0, it means it only has a header or nothing at all
If Application.WorksheetFunction.CountA(col) <= 1 Then
col.EntireColumn.Hidden = True
End If
Next col
Application.ScreenUpdating = True
End Sub