Using macro to create barcode

D

Daniel M

I have a word doc that has a table with 2 cells. In one cell i need to type
in a number, in the second cell i want the text copied from cell1 to cell2
but in a barcode (or different font) preceded with a * and ending with a *.
Can anyone give me some ideas on how to do this? I could run a macro on exit
of cell1 but i am not sure how to write the macro.

This is what i am looking for.
Cell, font, Fsize, data
Cell1, Arial, 12, 1234
Cell2, free3 of9, 20, *1234*

Thanks.
dm.
 
D

Doug Robbins - Word MVP

A macro containing the following code will insert the required data in the
cells in the second column of the first table in the document

Dim i As Long
Dim crange As Range
With ActiveDocument.Tables(1)
For i = 1 To .Rows.Count
Set crange = .Cell(i, 1).Range
crange.End = crange.End - 1
.Cell(i, 2).Range.Text = "*" & crange.Text & "*"
With .Cell(i, 2).Range.Font
.Name = "Free3 of 9"
.Size = 20
End With
Next i
End With

If the first row of the table is not to be translated, chage the For i = 1
to .Rows.Count to For i = 2 to .Rows.Count

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - 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