Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ray Ray is offline
external usenet poster
 
Posts: 267
Default Skip part of macro on re-run?

HI all -

I hope an MVP (or at least someone more experienced that myself) can
help ...

Is it possible to start running a macro part way through the code? An
example should help clarify:
Macro A has 10 steps (1-10) and is called by a commandbutton -- Steps
1&2 basically prep the effected worksheets to complete Steps 3-8.
Steps 9&10 add some formatting and error-checking.

If errors exist (step 10), Macro B reverses the results of Steps 9&10
(of Macro A) -- columns are deleted, formatting erased, etc.

Now, I want to have macro C be able to run steps 3-10 of Macro A --
can I tell it to run Macro A starting at step 3? how would I do this?

Or, do I just need to replicate the code for steps 3-10 in Macro C?

The solution to this specific case will be very useful in other
Projects, for sure ...!

TIA, Ray

  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Skip part of macro on re-run?

Ray,

If you break up macro A into 10 steps and use macro 1 to run steps 1-10, you
could use macro 2 to run steps 3-10.

Jim

"Ray" wrote:

HI all -

I hope an MVP (or at least someone more experienced that myself) can
help ...

Is it possible to start running a macro part way through the code? An
example should help clarify:
Macro A has 10 steps (1-10) and is called by a commandbutton -- Steps
1&2 basically prep the effected worksheets to complete Steps 3-8.
Steps 9&10 add some formatting and error-checking.

If errors exist (step 10), Macro B reverses the results of Steps 9&10
(of Macro A) -- columns are deleted, formatting erased, etc.

Now, I want to have macro C be able to run steps 3-10 of Macro A --
can I tell it to run Macro A starting at step 3? how would I do this?

Or, do I just need to replicate the code for steps 3-10 in Macro C?

The solution to this specific case will be very useful in other
Projects, for sure ...!

TIA, Ray


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
Skip a Macro Vick Excel Discussion (Misc queries) 2 December 22nd 09 05:06 PM
If cell is empty then run macro otherwise skip this macro [email protected] Excel Programming 3 June 12th 06 03:55 PM
IF-THEN to skip portion of macro excelnut1954 Excel Programming 1 November 23rd 05 04:09 PM
Sheets Skip Macro NICK Excel Discussion (Misc queries) 2 February 11th 05 07:16 AM
How to skip in a macro Bob Phillips[_6_] Excel Programming 1 February 9th 04 05:56 PM


All times are GMT +1. The time now is 12:28 PM.

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"