Coloring of different shapes based on time

Davidj13

New Member
Joined
Mar 2, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi There,

I am trying to solve the problem with coloring the shapes based on time and I am struggling with it for some time so hope someone can help me with this.

I have 19 shapes on excel sheet and each is having the name Bankomat_ and then number from 1 to 19. The output should be that shapes are "blinking" with yellow color one after another from 1 to 19 and then again start with 1 always in 2 seconds interval.

The blinking itself works fine but I have a problem with transfer to each of the shapes. Currently with the code pasted only the first shape is blinking and I tried to use for cycle but then it was always all the shapes blinking. I think its connected to the application itself but I just don't know how to move from "Bankomat_1" to "Bankomat_2".

If anyone would have some ideas how to work this out I would appreciate it:)

Thanks!
Jan

1646299073826.png
1646299102478.png
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I am also putting code in text, in case it would be easier for some of you:)

VBA Code:
Sub Prebarvovani_2()

RunTimer = Now + TimeValue("00:00:02")

Application.OnTime RunTimer, "Prebarvovani_2"

i = 1

If ActiveSheet.Shapes("Bankomat_" & i).Fill.ForeColor = RGB(255, 255, 255) Then

With ActiveSheet.Shapes("Bankomat_" & i)
.Fill.ForeColor.RGB = RGB(255, 255, 0)
End With

Else

With ActiveSheet.Shapes("Bankomat_" & i)
.Fill.ForeColor.RGB = RGB(255, 255, 255)

End With

End If

End Sub
 
Upvote 0
Hi,​
yes better but far less than linking your workbook on a files host website like Dropbox …​
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,121
Members
453,021
Latest member
Justyna P

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
Back
Top