ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   labelling (https://www.excelbanter.com/excel-programming/277255-labelling.html)

solo_razor[_3_]

labelling
 
hi,

does anybody know how i can write some code in visual basic that can
print something on a labelsticker using a zebra printer, where te
values are coming from an excelsheet. Also certain cells in this
sheet.

Regards,



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


David McRitchie[_2_]

labelling
 
I have a page on printing labels with Mail Merge in MS Word
from an Excel database. I imagine if you are set up to print
bar codes in Excel that all you need to do extra is to specify
the font for the barcode in your Word document for the field.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Tom Ogilvy" wrote in message ...
Might be easier to do this with Mailmerge in Word. You can still use excel
as the source of the data.

Otherwise, you would have to set up the data on the worksheet to mimic the
layout on the label, then set page dimensions to match what is needed to
position the information propertly on the printer.

Unless there is something special about a zerbar printer.

"solo_razor"
does anybody know how i can write some code in visual basic that can
print something on a labelsticker using a zebra printer, where te
values are coming from an excelsheet. Also certain cells in this
sheet.





Mike B[_3_]

labelling
 
If you can loop through your desired fields, you can send the target
text to the zebra printer (I'm assuming local) via the LPT port of
your PC. There are other methods, but this is easiest.

Private Sub Command1_Click()
Dim strZPL As String
Dim lngFileNum As Long
Dim i As Long

'Loop through your excel sheet
'Assign a value to strReturn
strZPL = "^XA"
strZPL = strZPL & "^PF0^FS"
strZPL = strZPL & "^FT150,250^A0N,244,224^FD " & strReturn & "^FS"
strZPL = strZPL & "^XZ"

lngFileNum = FreeFile()

Open "LPT1" For Output As lngFileNum
'Open Printer.DeviceName For Output As lngFileNum
'Open "\\ARHTEST\ITTEST" For Output As lngFileNum
Print #lngFileNum, strZPL
Close lngFileNum

'Continue your loop

End Sub


All times are GMT +1. The time now is 09:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com