Consolidating Macros

tvkrys

Board Regular
Joined
Jan 23, 2006
Messages
135
Hi all -

I have a file that requires multiple operations which I have broken up into several macros. I would like to string them together into one macro but there are two problems. I also have a related question.

1. Can a macro call up another macro or must the full code be added to a combined macro? If I can call it up, what would the code look like? Let’s say the macro to be called up is named “DeleteLeft” and is located in my PERSONAL.XLS file.

2. At the end of one macro, there is a decision to be made. If the answer is yes, I run a second macro. If the answer is no, I run a third macro, and then the second one. Is there a way to create a pop-up window at the end of the first macro that asks me if there is a cash issue, with a yes and a no button. Then, based on my answer, run the appropriate macro(s)? If so, what would the code look like?

3. The other problem is that there may or may not be an undisclosed number of links that must be removed. At the time, they are all within an established selection. Currently, I just keep clicking on a button that runs a custom “RemoveLink” macro. When there are no more links to remove, I get a run time error message, click “End” and then click on the next macro. (That way I don’t have to count how many links there are to remove. I just keep clicking till I get the error message.) Is there a way to have the macro run a loop until it runs out of an undetermined number of links to remove and then continue on with another macro or code? (The number of links to be removed numbers anywhere from 0 to 76, if that matters.)

I hope this all makes sense... :biggrin:
TIA, Krys
 
Thanks, guys! I'm busy with other priorities this week. I will work with this later and get back to you if I have any more questions... :biggrin: Krys
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,216,099
Messages
6,128,822
Members
449,470
Latest member
Subhash Chand

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