Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-31-2014, 11:50 AM
elh52 elh52 is offline Macro to loop through all cells in a table produced by a mail merge Mac OS X Macro to loop through all cells in a table produced by a mail merge Office for Mac 2011
Novice
Macro to loop through all cells in a table produced by a mail merge
 
Join Date: Aug 2014
Posts: 3
elh52 is on a distinguished road
Default

I've now got to this:







Sub BarcodeLabels()

Dim C As Cell
Dim objTable As Table

For Each objTable In ActiveDocument.Tables
For Each C In ActiveDocument.Tables(1).Range.Cells

Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:="*"
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:="* "
Selection.Expand wdLine
Selection.Font.Name = "Free 3 of 9"
Selection.Font.Size = 14
Selection.EndKey Unit:=wdLine
Selection.MoveLeft Unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Font.Name = "Arial"
Selection.EndKey Unit:=wdLine
Selection.Move Unit:=wdCell, Count:=1
Next C

Next objTable

End Sub

Which runs through the first page of labels quite happily, and then loops in the last cell in the table without moving on to the next page (which I presume is a separate table). Any ideas? I'd be very grateful for any help!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to loop through all cells in a table produced by a mail merge Mail Merge on Optional Row(s) of a Table Chris Wong Mail Merge 3 08-21-2019 12:55 PM
Macro to loop through all cells in a table produced by a mail merge Mail Merge Into Dynamic Table Jag618 Mail Merge 1 03-04-2013 11:26 PM
Macro to loop through all cells in a table produced by a mail merge mail merge with table nadja Mail Merge 5 03-06-2012 05:41 PM
Macro to loop through all cells in a table produced by a mail merge Macro to Merge Cells Row By Row in a Table KD999 Word VBA 4 02-20-2012 08:51 PM
Macro to loop through all cells in a table produced by a mail merge Word Doc Macro (mail Merge) ajolson1964 Word VBA 1 05-10-2011 10:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:57 PM.


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