Flashing Object

RogerC

Well-known Member
Joined
Mar 25, 2002
Messages
533
I've searched the board and found out how to makes cells flash in a Worksheet, but I need to make an object flash when the user activates a macro. In this case the object is a .jpg image. Has anyone ever done this?
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Barry Katcher

Well-known Member
Joined
Feb 25, 2002
Messages
4,053
No, but I sure would like to know how you got your cell to flash, tried that recently and retreated in frustration.
 

Dragracer

Board Regular
Joined
Jun 9, 2002
Messages
151
Roger, I modified the code supplied by Joe Was to flash a jpg. Give it a try and see if it works for you.

<pre>
Sub Flashjpg()
'modified code from Joe Was

Dim myJPG As Object
Dim x As Integer
Dim fSpeed

'Make this picture flash!
Set myJPG = ActiveSheet.Pictures("picture 1")
Application.DisplayStatusBar = True
Application.StatusBar = "... Select Cell to Stop and Edit or Wait for Flashing to Stop! "

'Make the cell range flash fast: 0.01 to slow: 0.99
fSpeed = 0.2

'Make cell flash, this many times!
Do Until x = 35

'Run loop!
DoEvents
Start = Timer
Delay = Start + fSpeed
Do Until Timer > Delay
DoEvents
myJPG.Visible = False

Loop
Start = Timer
Delay = Start + fSpeed
Do Until Timer > Delay
DoEvents
myJPG.Visible = True

Loop
x = x + 1
Loop
Application.StatusBar = False
Application.DisplayStatusBar = Application.DisplayStatusBar
End Sub

</pre>
 

RogerC

Well-known Member
Joined
Mar 25, 2002
Messages
533
That worked perfectly Dragracer! Just the effect I was looking for. Thanks!
 

Forum statistics

Threads
1,143,613
Messages
5,719,708
Members
422,242
Latest member
hishamkhatri

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