hide columns based on day of week

tintin1012000

Board Regular
Joined
Apr 27, 2011
Messages
237
Hi all,

I want a macro to hide columns based on the day of the week

If its Mon I want to hide all Columns B:S
If its Tue hide E:S
If Wed hide H:S
If Thur hide K:S
If Fri hide N:S

Thanks all
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
tintin1012000,

Perhaps this....

Code:
Sub Day_Hide()
Application.ScreenUpdating = False
Range("B:S").EntireColumn.Hidden = False
Select Case Weekday(Date, vbMonday)
Case 1
Range("B:S").EntireColumn.Hidden = True
Case 2
Range("E:S").EntireColumn.Hidden = True
Case 3
Range("H:S").EntireColumn.Hidden = True
Case 4
Range("K:S").EntireColumn.Hidden = True
Case 5
Range("N:S").EntireColumn.Hidden = True
End Select
End Sub

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,376
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top