ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to insert a Macro within a macro? (https://www.excelbanter.com/excel-discussion-misc-queries/11968-how-insert-macro-within-macro.html)

Thrava

How to insert a Macro within a macro?
 
I have a sub Format()

and I want another macro called: AddRows()

To run in the middle of the sub Format()Macro.

What I did doesn't work.
I had Sub Format()
.....
.....

Sub AddRows()
End sub

.....
End Sub.

How can I do this?


Don Guillett

try

Sub Format()
stuff
call AddRows()
End sub


--
Don Guillett
SalesAid Software

"Thrava" wrote in message
...
I have a sub Format()

and I want another macro called: AddRows()

To run in the middle of the sub Format()Macro.

What I did doesn't work.
I had Sub Format()
....
....

Sub AddRows()
End sub

....
End Sub.

How can I do this?




thrava

Ahhaah,
Thank you


-----Original Message-----
try

Sub Format()
stuff
call AddRows()
End sub


--
Don Guillett
SalesAid Software

"Thrava" wrote in

message
...
I have a sub Format()

and I want another macro called: AddRows()

To run in the middle of the sub Format()Macro.

What I did doesn't work.
I had Sub Format()
....
....

Sub AddRows()
End sub

....
End Sub.

How can I do this?



.


Don Guillett

actually when I copied yours I forgot to remove the () after addrows.
It can be

call adrows
or just
adrows


--
Don Guillett
SalesAid Software

"thrava" wrote in message
...
Ahhaah,
Thank you


-----Original Message-----
try

Sub Format()
stuff
call AddRows()
End sub


--
Don Guillett
SalesAid Software

"Thrava" wrote in

message
...
I have a sub Format()

and I want another macro called: AddRows()

To run in the middle of the sub Format()Macro.

What I did doesn't work.
I had Sub Format()
....
....

Sub AddRows()
End sub

....
End Sub.

How can I do this?



.





All times are GMT +1. The time now is 11:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com