Bubbles / Data / Charts

In my attached ss, there are ovals with percentages linked to cells inside them

I have created some if statements to show whether they should be red or green in colour

Can someone provide some vba code that will on refresh of all pivots, change them to red or green, depending on the result of the IF statement

Thanks!
EE-Bubbles.xlsm
Seamus2626Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Hi,

the reason why you have not received an abundance of eager replies to your question is ..

... your sample file links to another workbook on YOUR computer and the references all come back with a #Ref! error and all the oval shapes show as #Ref! too. It's impossible to do anything with that sample file.

Please copy the formulas that reference external files, then use Paste Special > Values to replace the formulas with their results. Save,

Upload that file.

Then we might have a chance at understanding what you want to achieve.

cheers, teylyn
Seamus2626Author Commented:
Sorry Teylyn,

ive attached the updated file
Copy-of-EE-Bubbles.xlsm
Rory ArchibaldCommented:
Try the attached. Note I cahnged the formulas in K and P so that they return actual percentages rather than formatted text.

Code in the sheet is:
Private Sub Worksheet_Calculate()
    Dim ovl As Oval
    
    For Each ovl In Me.Ovals
        If Range(Trim$(ovl.Formula)).Value < 0 Then
            ovl.Interior.Color = vbRed
        Else
            ovl.Interior.Color = vbGreen
        End If
    Next ovl
End Sub

Open in new window

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Seamus2626Author Commented:
Rory, that looks slick, one problem, there all turning green!
Rory ArchibaldCommented:
Did you note my comment about the formulas in columns K and P?

I also forgot to attach the file I used:
EE-Bubbles.xlsm

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Seamus2626Author Commented:
Got ya! thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.