hide column with date condition

faizee

Board Regular
Joined
Jan 28, 2009
Messages
181
I want to hide automatically
Sep-17
12345678910111213141516171819#21###25#27###31

<colgroup><col style="text-align: center;"><col span="30" style="text-align: center;"></colgroup><tbody>
</tbody>
the sat and sunday of this table,
when i change the month.. so the columns does not show sat and sunday

please help
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

SteveO59L

Well-known Member
Joined
Apr 21, 2004
Messages
7,896
something along the lines of

Dim c As Range, rng
Set rng = Range("f5:aj5")
For Each c In rng
If Weekday(c, 2) > 5 Then
c.EntireColumn.Hidden = True
Else
c.EntireColumn.Hidden = False
End If
Next c
 

Watch MrExcel Video

Forum statistics

Threads
1,099,078
Messages
5,466,488
Members
406,484
Latest member
kaksolver

This Week's Hot Topics

Top