Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Skipping sections of code

I have a long run of code (not modular). Is it possible
to set breaks on a particular section of code (begin and
end break) so that it will not run when the macro is
running? Or is the only way to do this on non modular
code to comment out the sections of code?

THanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Skipping sections of code

It is really poor practice to use, but VBA still includes the good ol' Goto
statement. The following will only print "Starting...":

Public Sub GotoTest()

Debug.print "Starting..."
Goto SkipEnd
Debug.print "Ending."

SkipEnd:

End Sub

This would be OK while you test your code, and it does work, but it is not
good practice to use it normally.

"ExcelMonkey" wrote:

I have a long run of code (not modular). Is it possible
to set breaks on a particular section of code (begin and
end break) so that it will not run when the macro is
running? Or is the only way to do this on non modular
code to comment out the sections of code?

THanks

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
reference row on another sheet skipping zeros but not skipping li. Brennan Downes Excel Discussion (Misc queries) 2 April 2nd 23 01:28 PM
Worksheet Sections RJ Excel Discussion (Misc queries) 0 June 7th 07 05:28 PM
Worksheet Sections RJ Excel Discussion (Misc queries) 2 June 7th 07 04:17 PM
if formula with two sections Sande Leonardo[_2_] Excel Discussion (Misc queries) 12 February 27th 07 06:45 PM
Background Color Code Sections JJ Charts and Charting in Excel 1 December 3rd 05 03:55 AM


All times are GMT +1. The time now is 05:08 AM.

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

About Us

"It's about Microsoft Excel"