+ Reply to Thread
Results 1 to 2 of 2

Open workbook, automatically hide columns based on past dates

  1. #1
    Registered User
    Join Date
    10-15-2019
    Location
    Canberra, Australia
    MS-Off Ver
    Windows 10, MS Office 2016
    Posts
    3

    Open workbook, automatically hide columns based on past dates

    Hello,

    I am new this Forum. I have tried multiple options from sources on the internet to get VBA to work for my problem, without success. So I thought I'd join this forum and see if anyone can assist.

    The problem:
    I would like the worksheet "Calendar" to automatically hide all columns with weeks that have passed.

    The Trick:
    One thing to note is that, the dates are written as week beginning, e.g. cell S3 is 14-Oct-19, representing week beginning Monday 14 October 2019 (today is 15-Oct-19) so I don't want this cell to be hidden, but all previous weeks should be hidden, e.g. Cells D3:R3 which go from 1-Jul-19 to 7-Oct-19. That is the column with the current week needs to remain visible even if the week beginning date has passed.

    Full column date range is:
    D3:DD3

    Many thanks in advance for your someone's help?

    Attachment:
    How do I attach the uploaded file - Calendar worksheet?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Open workbook, automatically hide columns based on past dates

    See next macro in a module
    Please Login or Register  to view this content.
    and put next other code in CALENDAR sheet's code

    Please Login or Register  to view this content.
    See file attached
    Attached Files Attached Files
    - Battle without fear gives no glory - Just try

+ 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] Automatically Hide or not Hide columns, based on cell value (to the left)
    By sherylt13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2018, 07:47 PM
  2. Replies: 2
    Last Post: 03-18-2017, 02:05 AM
  3. Hide Columns automatically based on date
    By ravisidhu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2015, 01:15 AM
  4. Hide Columns automatically based on year month(YYYY-mm)
    By Jeevhoney in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-12-2014, 12:53 AM
  5. Hide Columns automatically based on date
    By chrisjc19 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-06-2011, 03:32 PM
  6. How do I automatically hide columns in a worksheet based on a cell value?
    By dkhedkar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-04-2005, 09:06 PM
  7. Replies: 0
    Last Post: 03-04-2005, 02:43 PM

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