![]() |
#1
|
|||
|
|||
![]()
Hi all,
I'm very new indeed to macros so this may be a very simple question - if so, I'm sorry! I've carried out a mail merge on some data to make labels, and I now want to turn the first line of each label into a barcode. I've got a macro that will make the barcode, but instead of looping through the cells in the table it runs on the first cell over and over again. Can anyone help to diagnose what I've done wrong? The code is: Sub BarcodeLabels() Dim oRow As Row Dim oCell As Cell Dim oTbl As Table For Each oTbl In ActiveDocument.Tables For Each oRow In oTbl.Rows For Each oCell In oRow.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 Next oCell Next oRow Next oTbl End Sub Thank you for any help you can give! |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Chris Wong | Mail Merge | 3 | 08-21-2019 12:55 PM |
![]() |
Jag618 | Mail Merge | 1 | 03-04-2013 11:26 PM |
![]() |
nadja | Mail Merge | 5 | 03-06-2012 05:41 PM |
![]() |
KD999 | Word VBA | 4 | 02-20-2012 08:51 PM |
![]() |
ajolson1964 | Word VBA | 1 | 05-10-2011 10:15 PM |