Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am trying to create a "marquee" effect by looping through 3 fill effects. It does what I'm going after, but only performs the fill effects once, then stops. I am trying to get it to repeat from the beginning after the 3rd fill effect. Code: -------------------- Dim iCount As Integer Sub ColorChange() Dim dTime As Date dTime = Now Application.OnTime dTime + TimeValue("00:00:01"), "ColorChange" iCount = iCount + 1 If iCount = 1 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 13 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 8 End If If iCount = 2 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 13 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 8 End If If iCount = 3 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 13 End If If iCount = 3 Then iCount = 0 Application.OnTime dTime + TimeValue("00:00:01"), "ColorChange", , False End If End Sub -------------------- Thank you in advance -- grime ------------------------------------------------------------------------ grime's Profile: http://www.excelforum.com/member.php...o&userid=19227 View this thread: http://www.excelforum.com/showthread...hreadid=504978 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
remove the line that cancels the Ontime (move it to another routine). Make
dtime a public variable or you won't be able to stop it without closing Excel. -- Regards, Tom Ogilvy "grime" wrote in message ... I am trying to create a "marquee" effect by looping through 3 fill effects. It does what I'm going after, but only performs the fill effects once, then stops. I am trying to get it to repeat from the beginning after the 3rd fill effect. Code: -------------------- Dim iCount As Integer Sub ColorChange() Dim dTime As Date dTime = Now Application.OnTime dTime + TimeValue("00:00:01"), "ColorChange" iCount = iCount + 1 If iCount = 1 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 13 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 8 End If If iCount = 2 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 13 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 8 End If If iCount = 3 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 13 End If If iCount = 3 Then iCount = 0 Application.OnTime dTime + TimeValue("00:00:01"), "ColorChange", , False End If End Sub -------------------- Thank you in advance -- grime ------------------------------------------------------------------------ grime's Profile: http://www.excelforum.com/member.php...o&userid=19227 View this thread: http://www.excelforum.com/showthread...hreadid=504978 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm fairly new to the VBA thing. Can you explain that? ![]() Tom Ogilvy Wrote: remove the line that cancels the Ontime (move it to another routine). Make dtime a public variable or you won't be able to stop it without closing Excel. -- Regards, Tom Ogilvy "grime" wrote in message ... I am trying to create a "marquee" effect by looping through 3 fill effects. It does what I'm going after, but only performs the fill effects once, then stops. I am trying to get it to repeat from the beginning after the 3rd fill effect. Code: -------------------- Dim iCount As Integer Sub ColorChange() Dim dTime As Date dTime = Now Application.OnTime dTime + TimeValue("00:00:01"), "ColorChange" iCount = iCount + 1 If iCount = 1 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 13 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 8 End If If iCount = 2 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 13 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 8 End If If iCount = 3 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 13 End If If iCount = 3 Then iCount = 0 Application.OnTime dTime + TimeValue("00:00:01"), "ColorChange", , False End If End Sub -------------------- Thank you in advance -- grime ------------------------------------------------------------------------ grime's Profile: http://www.excelforum.com/member.php...o&userid=19227 View this thread: http://www.excelforum.com/showthread...hreadid=504978 -- grime ------------------------------------------------------------------------ grime's Profile: http://www.excelforum.com/member.php...o&userid=19227 View this thread: http://www.excelforum.com/showthread...hreadid=504978 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim iCount As Integer
Dim dTime as Date Sub ColorChange() dTime = Now Application.OnTime dTime + TimeValue("00:00:01"), "ColorChange" iCount = iCount + 1 If iCount = 1 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 13 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 8 End If If iCount = 2 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 13 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 8 End If If iCount = 3 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 13 End If If iCount = 3 Then iCount = 0 End If End Sub Sub StopAnimation() Application.OnTime dTime + TimeValue("00:00:01"), "ColorChange", , False End Sub -- Regards, Tom Ogilvy "grime" wrote in message ... I'm fairly new to the VBA thing. Can you explain that? ![]() Tom Ogilvy Wrote: remove the line that cancels the Ontime (move it to another routine). Make dtime a public variable or you won't be able to stop it without closing Excel. -- Regards, Tom Ogilvy "grime" wrote in message ... I am trying to create a "marquee" effect by looping through 3 fill effects. It does what I'm going after, but only performs the fill effects once, then stops. I am trying to get it to repeat from the beginning after the 3rd fill effect. Code: -------------------- Dim iCount As Integer Sub ColorChange() Dim dTime As Date dTime = Now Application.OnTime dTime + TimeValue("00:00:01"), "ColorChange" iCount = iCount + 1 If iCount = 1 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 13 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 8 End If If iCount = 2 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 13 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 8 End If If iCount = 3 Then ActiveSheet.Shapes("Group 1").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 2").Fill.ForeColor.SchemeColor = 8 ActiveSheet.Shapes("Group 3").Fill.ForeColor.SchemeColor = 13 End If If iCount = 3 Then iCount = 0 Application.OnTime dTime + TimeValue("00:00:01"), "ColorChange", , False End If End Sub -------------------- Thank you in advance -- grime ------------------------------------------------------------------------ grime's Profile: http://www.excelforum.com/member.php...o&userid=19227 View this thread: http://www.excelforum.com/showthread...hreadid=504978 -- grime ------------------------------------------------------------------------ grime's Profile: http://www.excelforum.com/member.php...o&userid=19227 View this thread: http://www.excelforum.com/showthread...hreadid=504978 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need to select non-adjacent cells with regular interval | Excel Discussion (Misc queries) | |||
Look-up a value within an interval | Excel Worksheet Functions | |||
how i create a interval | Excel Discussion (Misc queries) | |||
interval formula | Excel Discussion (Misc queries) | |||
Sum.if date is in an interval... | Excel Worksheet Functions |