D
dlmaley
I have read the other posts regarding this and did not find anything that
would help me. I think I'm starting to get there is no easy answer. Here is
what I have. Forgive me if it is awful...I am just starting to learn this.
Sub Macro3()
Dim X As Integer
Do Until X = 1000000
Application.Run MacroName:="Macro5"
Loop
MsgBox ("Macro Finished!")
End Sub
I am trying to loop a recorded macro (Macro5) that goes down 66 lines with
the Goto command and then formats that line with paragraph formatting Exactly
16Pt. I need this to keep going down 66 lines and formatting the line it hits
until the end of the document. My husband suggested the code shown above and
had me put X=1000000 going down 66 lines from the last record to try to get
it to end there. When I run this, I never see the Macro Finished! message,
and the cursor flashes at the end as though it is going back and forth
between the last 2 carriage returns. When I stop the macro, and check some
of the records, the 66th line is formatted correctly. I can use this as is if
I can get it to stop looping, but I would prefer the correct code to make it
loop until the end of document or the end of the file. If this goes back to
the top and starts formatting 66 lines down from the top of the document, it
will mess up the positioning of the data. Any suggestions would be
appreciated! Thanks!
would help me. I think I'm starting to get there is no easy answer. Here is
what I have. Forgive me if it is awful...I am just starting to learn this.
Sub Macro3()
Dim X As Integer
Do Until X = 1000000
Application.Run MacroName:="Macro5"
Loop
MsgBox ("Macro Finished!")
End Sub
I am trying to loop a recorded macro (Macro5) that goes down 66 lines with
the Goto command and then formats that line with paragraph formatting Exactly
16Pt. I need this to keep going down 66 lines and formatting the line it hits
until the end of the document. My husband suggested the code shown above and
had me put X=1000000 going down 66 lines from the last record to try to get
it to end there. When I run this, I never see the Macro Finished! message,
and the cursor flashes at the end as though it is going back and forth
between the last 2 carriage returns. When I stop the macro, and check some
of the records, the 66th line is formatted correctly. I can use this as is if
I can get it to stop looping, but I would prefer the correct code to make it
loop until the end of document or the end of the file. If this goes back to
the top and starts formatting 66 lines down from the top of the document, it
will mess up the positioning of the data. Any suggestions would be
appreciated! Thanks!