ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   step into process (https://www.excelbanter.com/excel-programming/274549-re-step-into-process.html)

Tom Ogilvy

step into process
 
sub macro1(sStr)
dim
if sStr < "" then
sStr = input box
End if
code
end sub


sub macro2()
Windows("test.xls").Activate
sStr = ""
Do
counter=counter+1
Application.Run "'test.xls'!macro1", sStr
loop until counter=10
end sub

or better

sub macro2()
Windows("test.xls").Activate
sStr = ""
sStr = Inputbox
Do
counter=counter+1
Application.Run "'test.xls'!macro1", sStr
loop until counter=10
end sub


Sub Macro1(sStr)
code you want to repeat
End Sub


--
Regards,
Tom Ogilvy

bob wrote in message
. ca...
i have macro1 with

sub macro1()
dim
input box
code
end sub

and macro2 that repeats macro1

sub macro2()
counter=counter+1
Windows("test.xls").Activate
Application.Run "'test.xls'!macro1"
if counter=
end if
end sub

how would i run all of macro1 the first time but jump to the code after
input box when repeating macro1 and keep using value from input box

string.
thanks






All times are GMT +1. The time now is 10:09 AM.

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