Thread: [Solved] Macro Loop Help
View Single Post
 
Old 09-15-2015, 07:28 AM
Twizzle008 Twizzle008 is offline Windows 7 32bit Office 2010 64bit
Novice
 
Join Date: Sep 2015
Posts: 6
Twizzle008 is on a distinguished road
Default Macro Loop Help

Hi

am very new to using macros in word so my knowledge is not the best. I often need to run payslips that come out in a text format. The file can have a range of 5 -100 payslips on it whichare not aligned to one page. I have created a macro (inserted below) which aligns it corretly to one page, which works fine, but in order for it to be repeated i have to either keep repeating the macro until and of data or copy and paste the main data of the macro to suit the number of payslips in the file. Could someone help me loop the macro until there is no more text in the document. I would be very greatful for any assictance.

Sub TestArun()
'
' TestArun Macro
'
Selection.TypeParagraph
Selection.MoveDown Unit:=wdLine, Count:=16
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.MoveDown Unit:=wdLine, Count:=17
Selection.TypeParagraph
Selection.TypeParagraph
End Sub
Reply With Quote