Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning everyone, I created a macro where it enters a loop (for) and I need this macro to be run when I click the button again how I do it?
Do a Break (Ctrl + Pause)
I have this example of how to do macro loop to abort after the macro runs and there is some function that I can abort the macro. ??
set obj = ActiveDocument.GetSheetObject( "TX01" )
for RowIter = 0 to obj.GetRowCount-1
for ColIter =0 to obj.GetColumnCount-1
set cell = obj.GetCell(RowIter,ColIter)
msgbox(cell.Text)
next
next
Do a Break (Ctrl + Pause)
Thanks it worked, would have as I put it on a button?
No
Use an Inputbox instead of a msgbox:
sub test
for i = 1 to 100000
Input = InputBox(i & " Type Q to quit")
if Input = "q" or Input = "Q" then exit sub
next
end sub
thank you