![]() |
#1
|
|||
|
|||
![]()
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 |
Tags |
macro, vba, word macro |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to loop through all cells in a table produced by a mail merge | elh52 | Word VBA | 4 | 08-31-2014 10:50 PM |
![]() |
damaniam | Word VBA | 7 | 02-21-2014 07:12 AM |
![]() |
damaniam | Word VBA | 11 | 12-05-2013 08:28 AM |
![]() |
Yamaha Rider | Word VBA | 2 | 02-07-2012 05:33 PM |
![]() |
Catalin.B | Excel Programming | 2 | 09-08-2011 11:37 PM |