+ Reply to Thread
Results 1 to 4 of 4

VBA to Conditionally format date range on calendar

  1. #1
    Registered User
    Join Date
    06-04-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    36

    Cool VBA to Conditionally format date range on calendar

    Hi,

    Looking for some advice on the best way to achieve my goal. In order to best understand what I am trying to accomplish please see the attached workbook.

    Looking to have the 'Activity#' populate to the corresponding 'Start Date' cell on the calendar, then conditionally format all cells in that row until the 'End Date' of that activity is reached.

    Logical issues that need to be taken into account that will ultimately shape how I accomplish this task:
    • Must check cell for conditional format, if already in use move to next row, and so on until empty row is found.
    • Must be able to move across and down to accommodate activities spanning more than a week.
    • No same colour can be used in adjacent column(or row, unless too complex).
    • After placing 'Activity#' and formatting must then colour match to the source 'Activity#'.
    • Must be dynamic code, I will be using on every month of year, therefore dates will never be in same cells.

    Looking for an excel vba expert to tell me whether this is worth the time/effort or if it is even possible!

    If you feel that this is possible but will require a different calendar or spacing please let me know, I am open to all suggestions

    Thanks,

    Alain

    EDIT: Example Workbook Updated See Source/Home/Jan Tabs...)
    Attached Files Attached Files
    Last edited by am_hawk; 11-24-2014 at 04:25 PM. Reason: Updated Example Workbook

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: VBA to Conditionally format date range on calendar

    I'll use my now favourite statement..."anythings possible in VBA"

    What you're looking for is definitely doable and in the format you're after.

    Couple of things to check though.

    1. Is this a continous calendar? ie does January follow on in the next cell to 31/12?
    2. If not, are the dates involved always going to be within the month in question? *ignore that, just seen your sample data and they arent....where will the other months be? *EDIT AGAIN! Im English, we format dates properly, yours are all in December just written wrong!
    Last edited by pjwhitfield; 11-24-2014 at 03:37 PM.
    If someone has helped you then please add to their Reputation

  3. #3
    Registered User
    Join Date
    06-04-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: VBA to Conditionally format date range on calendar

    Just to note, I'm not objecting to any manual labour to maintain this I am just hoping to automate as much as possible.

    Aswell I am not looking nor expecting someone to spoon feed the code, i just need to be pointed in the right direction.

    18 tabs one for each month starting Jan 1 2015.
    1 tab 'Source Data' updated once daily
    1 tab 'Home' - showing the current month + upcoming two months(possibly just find the current month and copy it and the next two from their respective sheets and past to 'Home')

    To make it easier it will be static, therefore no tabs deleted after the month has passed type of thing and no new months created. It does not need to be a rolling 18 months. I will create a new one after 18 months*

    *Unless of course one of you geniuses here can point me to a solution that is somewhat simple, if not no worries!

    Thanks for the feedback! I'll be manually updating my example workbook to reflect any changes!

    Thanks,

    Alain

  4. #4
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: VBA to Conditionally format date range on calendar

    Im not sure Ive covered everything in your last post, but it should be enough to be going on with, Ive slightly amended the data list just to make it easier to pull the different activities but thats a small part of the code and therefore can be amended to fit your requirements.
    Attached Files Attached Files

+ 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. Need help for macro to conditionally format a selected range
    By smusyaju in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2014, 04:44 PM
  2. [SOLVED] Conditionally Format Dynamic Range
    By hamidxa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2014, 12:43 PM
  3. Replies: 0
    Last Post: 05-14-2012, 08:43 PM
  4. [SOLVED] Vba code to conditionally format a specific range
    By kelwood in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-29-2012, 10:14 AM
  5. I need to Conditionally Format a count against a due date
    By louiethefuzz in forum Excel General
    Replies: 2
    Last Post: 01-08-2010, 05:25 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