+ Reply to Thread
Results 1 to 9 of 9

Shape coloring macro tied to formula

  1. #1
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Shape coloring macro tied to formula

    Hey guys,

    This is probably something easy but I can't figure it out. I have this macro to color shapes depending on the value

    Please Login or Register  to view this content.
    Works fine when I enter values from 1 to 100 at T5, U5, V5. However these cells should be formulas and when I change them, coloring stops working.(for example this is the formula for T5: =IFERROR((($T$2/$T$3)*6.25)/100; "")

    How do I fix this?

    Thank you!

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Shape coloring macro tied to formula

    formula calculations do not trigger the change event so you would have to use the calculate event and check all the cells each time it triggers (there is no Target argument for the Calculate event)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Shape coloring macro tied to formula

    I think you overestimated my knowledge on VBA What I understand from your response is that this macro wont work with formulas, and I should look for a macro that starts with Worksheet_calculate to do the job, right? Oh, well I will look for one now.

    Thank you Josie.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Shape coloring macro tied to formula

    Please Login or Register  to view this content.
    for instance :-)

  5. #5
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Shape coloring macro tied to formula

    This is awesome, works like a charm!

    Thank you so much Josie!

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Shape coloring macro tied to formula

    you're welcome :-)

  7. #7
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Shape coloring macro tied to formula

    Hmm, one more question.
    When I open another excel file I get an error, as it seems the new file runs the macro from this workbook.

    How do I limit this macro only to this file? (Also I change the names all the time like V22, V23 etc., if that can be taken into account).

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Shape coloring macro tied to formula

    perhaps
    Please Login or Register  to view this content.
    not sure what you meant about changing the names-what names?

  9. #9
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Shape coloring macro tied to formula

    Now it is perfect!

    Thank you once again for your help

+ 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] Use a button to control a macro that inserts an image into a shape or resets the shape
    By nwb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2013, 04:41 PM
  2. Replies: 0
    Last Post: 11-30-2012, 01:29 PM
  3. Need help programming a Macro tied to a button
    By lucidriceball in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-21-2012, 03:15 PM
  4. Replies: 0
    Last Post: 04-27-2012, 04:22 PM
  5. Replies: 7
    Last Post: 04-03-2010, 03:48 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