+ Reply to Thread
Results 1 to 4 of 4

How can I change the fill of a shape based on dates?

  1. #1
    Registered User
    Join Date
    07-12-2022
    Location
    Honolulu, HI
    MS-Off Ver
    16.62 - Office 19
    Posts
    2

    Question How can I change the fill of a shape based on dates?

    Hello! I am trying to use Microsoft Excel to create a sheet that has a table and a long rectangular bar shape that corresponds to each row of the table. This table will have 2 columns: One for the Name and one for the Start Date. I want to configure this sheet so that any time someone changes the start date, it is reflected in the fill of the shape. For example, if someone changes the date for "Party" to July 2nd (approximate midpoint of the year), then I want the shape that corresponds to "Party" to be 50% full. Is there a way to do this in excel? Or should I be using something else. Any insight is greatly appreciated :)

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How can I change the fill of a shape based on dates?

    You could do this with a macro.
    Is it vital you use a bar shape? Conditional formatting on say a series of 10 adjacent cells that look like a bar could also be used.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-12-2022
    Location
    Honolulu, HI
    MS-Off Ver
    16.62 - Office 19
    Posts
    2

    Re: How can I change the fill of a shape based on dates?

    Thanks for the reply! No, not necessarily a bar shape. But I don't want the bar to be super large where I need to zoom out a lot to see the whole thing.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,739

    Re: How can I change the fill of a shape based on dates?

    I believe that what Richard is proposing would be something like what is displayed in the attached file.
    1. The conditional formatting formula for the 10 cells is: =COLUMNS($C1:C1)<=$N1
    2. Cell N1 is populated using: =DATEDIF(P1,B1,"d")/DATEDIF(P1,Q1,"d")*10
    3. Cells P1:Q1 contain =DATE(YEAR(TODAY()),1,1) and =DATE(YEAR(TODAY()),12,31).
    Note that cells N1, P1:Q1 could be moved and/or hidden for aesthetic purposes.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Change Shape Fill colour based on cells values.
    By pipoliveira in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-26-2020, 09:21 AM
  2. need code to change shape fill to a picture when another cell = 1
    By Muzza86 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-16-2014, 05:57 AM
  3. need the fill of a shape to change to a image
    By Muzza86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2014, 05:02 AM
  4. [SOLVED] Change Shape Fill Color Based on Cell Value
    By Justair07 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-28-2013, 09:35 AM
  5. Change Color of text on a shape to No Fill
    By gkumthekar in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-28-2013, 04:38 PM
  6. Change shape fill color depending on cell value
    By xe-dingo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-05-2013, 03:46 AM
  7. [SOLVED] Change fill colour of shape with a click
    By schlepel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2012, 09:34 AM

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