+ Reply to Thread
Results 1 to 3 of 3

VBA/macro to hide columns based on particular week ?

  1. #1
    Registered User
    Join Date
    03-14-2023
    Location
    Switzerland
    MS-Off Ver
    Office 365
    Posts
    4

    VBA/macro to hide columns based on particular week ?

    Hi,

    Here's my case: I'm making a workshift planning calendar for my work. I'm using 365 columns for each day of the year. As you can imagine, this translates in a very wide column navigation, making it hard to focus.
    I intend to work on a week basis, so I only need to show 7 columns (7 days, based on week number) at the time, everything else should ideally be hidden. I would then use buttons to navigate from a week to another.

    For know I've used the cell grouping function but I would like something cleaner without distractions.

    Is it someting easy to do?

    Thanks for your help


    P.S. - sorry if the topic is repeated or if I'm posting in the wrong place
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: VBA/macro to hide columns based on particular week ?

    I ungrouped the columns then I tried below

    see if it works for you

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: VBA/macro to hide columns based on particular week ?

    Salut,

    I have added some macros to focus on the current week and also to move forward or backwards in weekly steps.

    I noticed that you have the weekly blocks "Semaine.." set to Monday > Sunday. The formula however is looking at a Sunday > Saturday week.
    Also try to avoid merging cells and use some conditional formatting if possible. Makes it easier to update when the weeks, months change etc.


    Let us know if that works for you.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    If your Question is answered; please mark it SOLVED. If you are happy with a member's solution, say 'Thanks' and click the 'Star' to Add Reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to hide columns based on column value
    By Laurence96 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2021, 09:24 AM
  2. [SOLVED] Macro for hide the complete row based on 4 columns value
    By Neilesh Kumar in forum Excel General
    Replies: 5
    Last Post: 08-01-2017, 11:38 AM
  3. [SOLVED] Macro to Hide Columns based on Drop-Down
    By Darkly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2015, 12:47 PM
  4. Macro to hide columns based on a cell value
    By polcen in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-20-2012, 10:42 AM
  5. [SOLVED] Macro to hide columns based on contents
    By samcdavies in forum Excel General
    Replies: 1
    Last Post: 06-22-2012, 04:56 AM
  6. Hide/Show columns based on Day of week
    By excelbobabc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2009, 11:07 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1