K0st4din
Well-known Member
- Joined
- Feb 8, 2012
- Messages
- 501
- Office Version
- 2016
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
Hello everyone, after quite a bit of searching around the site I found a query similar to my case and found an almost 100% solution with this macro.
However, in my case, could you please help me how on the line that says exactly which columns to hide, I write odd columns, for example B:B, K:K, O:O, Z:Z and etc. until the end, to write the desired columns.
Thanks in advance!
However, in my case, could you please help me how on the line that says exactly which columns to hide, I write odd columns, for example B:B, K:K, O:O, Z:Z and etc. until the end, to write the desired columns.
Thanks in advance!
VBA Code:
Sub Hide_Columns()
Application.ScreenUpdating = False
On Error GoTo M
Dim Del As Variant
Del = Array("BB", "CC", "DD", "EE", "FF", "GG", "HH", "II", "JJ", "KK", "LL", "MM", "NN")
ans = UBound(Del)
For i = 1 To ans + 1
Sheets(Del(i - 1)).Columns("F:AN").Hidden = True
Next
Exit Sub
M:
MsgBox "No such sheet exist"
Application.ScreenUpdating = True
End Sub