Results 1 to 8 of 8

Thread: Hide Month Calender Date Column | Excel | VBA
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    May 2019
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Hide Month Calender Date Column | Excel | VBA

    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/1UBz...ew?usp=sharing

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    23,162
    Post Thanks / Like
    Mentioned
    390 Post(s)
    Tagged
    41 Thread(s)

    Default Re: Hide Month Calender Date Column | Excel | VBA

    Hi & welcome to MrExcel.

    Select AG15:AI27 & with conditional format use
    =AG$15=""
    set colour to "no colour" & Borders to "None"
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 2003 & 2013 on Win 7

  3. #3
    New Member
    Join Date
    May 2019
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide Month Calender Date Column | Excel | VBA

    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]

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    23,162
    Post Thanks / Like
    Mentioned
    390 Post(s)
    Tagged
    41 Thread(s)

    Default Re: Hide Month Calender Date Column | Excel | VBA

    Did you try my suggestion?
    It will remove any highlights & borders on those cells
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 2003 & 2013 on Win 7

  5. #5
    New Member
    Join Date
    May 2019
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide Month Calender Date Column | Excel | VBA

    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

  6. #6
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    23,162
    Post Thanks / Like
    Mentioned
    390 Post(s)
    Tagged
    41 Thread(s)

    Default Re: Hide Month Calender Date Column | Excel | VBA

    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
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 2003 & 2013 on Win 7

  7. #7
    New Member
    Join Date
    May 2019
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Hide Month Calender Date Column | Excel | VBA

    Fluff => can you please apply on my below excel and give i will go through it where i am missing the logic as i not good with VBA

    My Working Excel Sheet [100% safe Google Drive Link]

    https://drive.google.com/file/d/1UBz...ew?usp=sharing

  8. #8
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    23,162
    Post Thanks / Like
    Mentioned
    390 Post(s)
    Tagged
    41 Thread(s)

    Default Re: Hide Month Calender Date Column | Excel | VBA

    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.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 2003 & 2013 on Win 7

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •