Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default how to stop running vba code without loosing printed data on the sheet?

hi everybody,

I have a small problem. Is there anyway to stop a running vba excel
code without loosing the printed data up to stopping time? i.e. I want
to stop program and then check some results , is it possible?

thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to stop running vba code without loosing printed data on the sheet?


look up some of the Debug features either a BREAKPOINT or a WATCH might
help as these do not stop the code but just suspend it. After checking
your values the code can continue from where it stopped.

(or a STOP statement)

eg if myval="ABC" then stop

hope this helps


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=552895

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default how to stop running vba code without loosing printed data on t

Also try:

Alt + F11
Locate the Function or Sub you are interested in, and then the line you want
to stop at. Press F9
Click View | Immediate Window

When the code runs (F5), it iwill stop on the line at which you pressed F9.
All the variables are available for interrogation: in the Immediste window
type
?VarName
to see its content

?Vartype(VarName)

tells you the type of the variable

?Typename(VarName)

tells you the TYPE of the variable

PS: VarName above is your variable name.

Press F8 to execute one line at a time.

As suggested, learn to use the Debug option in the VBE.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
stop excel sheet from being printed Zambian Excel Discussion (Misc queries) 2 December 6th 08 06:10 PM
Stop code from running when I click "Cancel" Dean[_9_] Excel Programming 3 March 2nd 06 12:34 AM
code for showing a sheet has been printed Giselle Excel Worksheet Functions 0 February 8th 06 11:56 PM
stop running code lou sanderson Excel Programming 0 November 29th 05 07:21 PM
VBA and determining which sheet the code is running under jake Excel Programming 2 April 28th 04 04:43 PM


All times are GMT +1. The time now is 02:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"