+ Reply to Thread
Results 1 to 6 of 6

Cell data changes its Specified fill shape color

  1. #1
    Registered User
    Join Date
    07-26-2020
    Location
    Ohio
    MS-Off Ver
    2016
    Posts
    4

    Cell data changes its Specified fill shape color

    Hello, I just joined this sight and am very new to VBA. I am currently in the process of trying to understand the function. I am in request of a code that would change the Shape Fill color based on cells drop down menu value, the values are 4mm, 6mm, 8mm, and stop". The code I am looking for function would take the value from the cells in the "Z" column and turn the specific oval either blue, red, yellow, or green. I tried to use a code similar to what i was looking for but I had no luck when putting in my data.

    any help or a point in the correct direction would be greatly appreciated


    I have attached a sample file to this thread.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Cell data changes its Specified fill shape color

    The only efficient way I can see this working for you is if you can name the ovals with the same number as the corresponding rectangles. For example, if a rectangle is named "Rectangle 10" then the associated oval should be "Oval 10". if a rectangle is named "Rectangle 47" then the associated oval should be "Oval 47". If you can do that, please attach an updated file.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    07-26-2020
    Location
    Ohio
    MS-Off Ver
    2016
    Posts
    4

    Re: Cell data changes its Specified fill shape color

    Okay, I renamed as you said. Is there anything I could study to understand how this actually works? I would really like to understand the whys and why nots.
    Attached Files Attached Files

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Cell data changes its Specified fill shape color

    Try the attached file. Simply make a selection in column Z. The macro is a worksheet change event which is triggered automatically when a change is made in a cell. In your case, the cell change is in column Z. To see the macro, do the following: right click the tab name for your sheet and click 'View Code'. Close the code window to return to your sheet.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-26-2020
    Location
    Ohio
    MS-Off Ver
    2016
    Posts
    4

    Re: Cell data changes its Specified fill shape color

    Awesome, this is exactly what I was looking for. thank you

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Cell data changes its Specified fill shape color

    You are very welcome.

+ 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. shape color fill control with cell value private sub
    By canguest in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-12-2018, 05:20 PM
  2. [SOLVED] Code VBA for changing fill color of shape base on data of cells
    By TanNguyen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-07-2015, 08:39 PM
  3. [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
  4. 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
  5. 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
  6. How to color-fill blank cells, then once data is entered cell is no-fill
    By hatemail13 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2013, 07:57 PM
  7. Fill Cell with Color from Shape's color code
    By excelnewbie80 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-02-2012, 05:34 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