Jenaustin29
New Member
- Joined
- Oct 12, 2023
- Messages
- 3
- Office Version
- 2016
- Platform
- Windows
I'm trying to add to my macro. Can you help me hid columns that c3through S3 = "-"
It's changes for customers so I cant sat hide N-S. The code I was give is not working.
'Hide empty columns from end
Dim i As Long, rng As Range
Set rng = Range("C3:S3")
For i = rng.Cells.Count To 1 Step -1
If rng.Item(i).Value = "-" Then
Columns(rng.Item(i).Column).Hidden = True
Else
Exit For
End If
Next
It's changes for customers so I cant sat hide N-S. The code I was give is not working.
'Hide empty columns from end
Dim i As Long, rng As Range
Set rng = Range("C3:S3")
For i = rng.Cells.Count To 1 Step -1
If rng.Item(i).Value = "-" Then
Columns(rng.Item(i).Column).Hidden = True
Else
Exit For
End If
Next