Hide Month Calender Date Column | Excel | VBA

jackbhai

New Member
Joined
May 19, 2019
Messages
18
Hide Month Calender Date Column | Excel | VBA
I have a Leave Tracker Excel where i want to Hide the Remaining Date Columns for Particular Months Which as Only 28 days or 30 days
For example
Example 1 : Assume i have Month => FEB YEAR 2019 => It as only 28 Days so remaining Days [29,30,31] Column should be Hide
Example 2 : Assume i have Month => JUNE YEAR 2019 => It as Only 30 Days so remaining Day [31] Column should be Hide
Below is the Video To see How it Appears for my excel
This my Video on Youtube => About issue => https://youtu.be/AjqX5t-3XHE
My Working Excel Sheet [Google Drive Link]
https://drive.google.com/file/d/1UBzaUFIlGUdqcfmJ-9zuR9eKf3XZXBzO/view?usp=sharing
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi & welcome to MrExcel.

Select AG15:AI27 & with conditional format use
=AG$15=""
set colour to "no colour" & Borders to "None"
 
Upvote 0
Fluff
if you see my above video you will come to know i am using spinner
As soon as i change the month the Month as Only 28 days so remaining Dates 29,30,31 should get hide
And if i Change to another Month using spinner then the Month as 31 days then it should display with 31 days
The main aim is i am Using Holiday table to highlight holidays that why even if the month as only 28 days then also highlighting remaining days which should be not get highlighted [29,30,31]
 
Upvote 0
Did you try my suggestion?
It will remove any highlights & borders on those cells
 
Upvote 0
Fluff i want to Hide not to Change Color to none Bro
its a leave tracker excel bro if Month as 28 days remaining days should get Hide not Color change to None and border to none
 
Upvote 0
In that case How about
Code:
Sub jackbhai()
   Dim Dte As Date
   Dim Clmn As Long
   Dte = DateSerial(Range("B11"), Range("B5"), 1)
   Clmn = Day(Application.EoMonth(Dte, 0)) + 5
   Range("AG:AI").EntireColumn.Hidden = False
   If Clmn < 36 Then
      Range(Cells(1, Clmn), Cells(1, "AI")).EntireColumn.Hidden = True
   End If
End Sub
Assign it to both spinners
 
Upvote 0
You will need to do it yourself, as I have no way of supplying you the amended file.
Add the code to a regular module, then right click one of the spinners & select assign macro, then select the macro from the list that appears.
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,142
Members
448,551
Latest member
Sienna de Souza

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