Blinking Stars Effect for Shapes (VBA)

ybr_15

Board Regular
Joined
May 24, 2016
Messages
198
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
I see a post at Blinking Text In Excel for blinking text. I just wondering how to make blinking stars effect in excel using shapes?. Example, I have 10 stars shape in excel and how to make them blinking like stars (randomly maybe, not in the same time). And I want 1 button to start and 1 button to stop them too. Thank you
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

ybr_15

Board Regular
Joined
May 24, 2016
Messages
198
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Maybe you can get an idea of how from my mini-blog article here...

<!-- title / author block --> A Blinking Christmas Tree
Thanks for your answer, Rick. It's like what I want but I have a question. I want using just 3 colors (RGB color code) for blinking. Can you help me how do that? Thank you very much

Here your code before:
Code:
Dim X As Long, Colors As Variant  Colors = Array(255, 16711680, 16751001, 65535, 52377, 26367)
  Do
    DoEvents
    If Not OnOffToggle Then Exit Sub
    For X = 1 To ActiveSheet.Shapes.Count
      ActiveSheet.Shapes(X).Fill.ForeColor.RGB = CLng(Colors(Int(6 * Rnd)))
    Next
    DoEvents
    Application.Wait Now + TimeSerial(0, 0, 1)
  Loop
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
37,958
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
I want using just 3 colors (RGB color code) for blinking. Can you help me how do that?
When you say "just 3 colors (RGB color codes)", do you mean the 3 color values RedVal, GreenVal, BlueVal in RGB(RedVal,GreenVal,BlueVal) or do you mean three separate physical colors for the shape's color? If the latter, then what are the actual colors and did you want them randomly assigned?
 
Last edited:

ybr_15

Board Regular
Joined
May 24, 2016
Messages
198
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Hi Rick, thanks again for your reply. What I mean is this: I have 3 color RGB, they are (237,85,101), (79,193,233), and (160,212,104). How can I implement this code? and can you explain about CLng in your code (why do you use it)? Thank you very much
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,974
Messages
5,856,600
Members
431,823
Latest member
irtezazaz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top