+ Reply to Thread
Results 1 to 3 of 3

Alternating a shape's fill colour for a fixed period of time

  1. #1
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Alternating a shape's fill colour for a fixed period of time

    Hi,

    I have a shape [Oval 1] on the active sheet.
    I want to make the shape's fillcolor toggle back and forth between 2 colours for a few seconds to attract the user's attention but am not having any luck.

    Here's my attempt:

    Please Login or Register  to view this content.
    The above simply changes the colour once rather than flashes a couple of times between the 2 desired colours.

    Anyone any ideas what I'm missing out on?

    Many thanks for any and all assistance!
    Last edited by deadlyduck; 10-06-2010 at 05:18 AM.
    Excel 365 user. To unblock a downloaded macro-enabled workbook, go to your "Downloads" folder > right click on the workbook name > click 'Properties' > check the 'Unblock' checkbox. You can now open the workbook.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Alternating a shape's fill colour for a fixed period of time

    Hello deadlyduck,

    You did not have your myswitch statement within the loop. You also need to add a time delay. The loop runs so fast, your eyes can not see the color change. Here is a macro to pause the macro for one half of a second. You can change the delay to suit you.

    Time Delay Macro
    Please Login or Register  to view this content.

    Your Macro with Changes Added
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Re: Alternating a shape's fill colour for a fixed period of time

    Thanks for this Leith- it does exactly what I need!

    I'll mark as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1