bras0782
11-28-2001, 05:47 AM
I'm using VBA wuth Excel and have a loop running which scans through data and plots it on a chart (like a dynamic graph).
When I pres escape it come up with the 'Debug' error asking if I wish to Debug or End (the one that also comes up when you press Ctrl+Break).
What I would like instead is to be able to simply exit the routine when the escape button is pressed. How do I do this?
I gather that I'll need a line which checks to see if a keyb input is received, but the help feature is useless for lettnig me know http://www.sharkyforums.com/ubb/frown.gif.
The code would look something like this:
For i=1 to [...].count
[code line1]
[code line2]
['if Esc is pressed'] then Exit Sub
Next i
(anything in square brackets is obviously not code http://www.sharkyforums.com/ubb/biggrin.gif)
Thanks
------------------
Athlon TB 800MHz
Abit KT7a-RAID
250W PSU, Enlight Case
512MB PC133 SDRAM
30.7GB IBM Deskstar 7200RPM
32MB Diamond Viper770 Riva TNT2
Yamaha 6416 CDRW (SCSI)
16x Pioneer 106s DVD-ROM
52x LG Electronics CDROM
SB Live! 1024
Creative FPS1000 Speakers
When I pres escape it come up with the 'Debug' error asking if I wish to Debug or End (the one that also comes up when you press Ctrl+Break).
What I would like instead is to be able to simply exit the routine when the escape button is pressed. How do I do this?
I gather that I'll need a line which checks to see if a keyb input is received, but the help feature is useless for lettnig me know http://www.sharkyforums.com/ubb/frown.gif.
The code would look something like this:
For i=1 to [...].count
[code line1]
[code line2]
['if Esc is pressed'] then Exit Sub
Next i
(anything in square brackets is obviously not code http://www.sharkyforums.com/ubb/biggrin.gif)
Thanks
------------------
Athlon TB 800MHz
Abit KT7a-RAID
250W PSU, Enlight Case
512MB PC133 SDRAM
30.7GB IBM Deskstar 7200RPM
32MB Diamond Viper770 Riva TNT2
Yamaha 6416 CDRW (SCSI)
16x Pioneer 106s DVD-ROM
52x LG Electronics CDROM
SB Live! 1024
Creative FPS1000 Speakers