Automatic number fill-in on Labels

B

Bridgett

Is it possible to have word automatically fill in a series of numbers on
Labels. I need a set of labels, counting by fives, from 1 to 3500. Just
wishing I didn't have to key in every number....0001-0005, etc.
 
G

Graham Mayor

See the second method on the page linked by Stefan and use the following
version of the macro listed there to increment the numbers by 5

Sub FRWithSequentialNumber()
Dim findText As String
Dim startNum As String
Dim myRange As Range
Set myRange = ActiveDocument.Range
startNum = 1
findText = "******"
With myRange.Find
.Text = findText
.MatchWholeWord = True
While .Execute
myRange.Text = Format(startNum, "0000")
If startNum = 1 Then
startNum = startNum + 4
Else
startNum = startNum + 5
End If
myRange.Collapse direction:=wdCollapseEnd
Wend
End With
End Sub

I think I may now have to update the add-in on that page to allow for such
number sequencing :(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top