Need code for having a keystroke stop the main code

kualjo

Board Regular
Joined
Aug 15, 2006
Messages
110
I need to have a cell flash back and forth between colors and continue to do so until the Enter key is pressed. I've seen this before, but can't remember how it goes. The code is just a simple loop that counts to a certain number, changes the cell color, starts the count over, changes the color back, then repeats until you hit Enter. Also, it would be helpful to change the flash rate, to speed it up or slow it down; do certain loop counts equate to a specific amount of time? Appreciate any help.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
If you have the code, then, it should be fairly simple to include, at the end of the loop, code that looks at the keyboard, and compares the current keypress with the ASCII code for Enter, which is 13, and, if so, to go to the end of the program. But, not being into VBA, I cannot help farther.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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