Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-15-2015, 07:28 AM
Twizzle008 Twizzle008 is offline Macro Loop Help Windows 7 32bit Macro Loop Help Office 2010 64bit
Novice
Macro Loop Help
 
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
 

Tags
macro, vba, word macro



Similar Threads
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
Macro Loop Help Loop Macro to Edit Date damaniam Word VBA 7 02-21-2014 07:12 AM
Macro Loop Help Loop Macro to Edit Date damaniam Word VBA 11 12-05-2013 08:28 AM
Macro Loop Help Macro to loop in Word Yamaha Rider Word VBA 2 02-07-2012 05:33 PM
Macro Loop Help Macro to loop in subfolders, change links, export xml data Catalin.B Excel Programming 2 09-08-2011 11:37 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:17 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft