Create Labels in Excel from List and print

Prashant1211

New Member
Joined
Jun 9, 2020
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
Dear VBA Experts,

I am trying to create labels in Excel from List. List is on Sheet 1 & label format is in Sheet 2.
what i want is Macro starts picking Value from 2nd Row (sheet 1, A2) and fill in the label format in sheet 2. Then print it and move to next row in sheet 1 till labels for all the rows are not Generated and printed. I want Sheet Page A6 and better if all the labels in can save in PDF format.

Can anyone please help me in creating the macro for the same. Thank you very much for your help.

Regards
Prashant1211
 

Attachments

  • Image.jpg
    Image.jpg
    47.7 KB · Views: 13

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

rpaulson

Well-known Member
Joined
Oct 4, 2007
Messages
1,172
VBA Code:
Sub do_it()

Dim ws1 As Worksheet, ws2 As Worksheet
Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")

Application.Dialogs(xlDialogPrinterSetup).Show

lr = ws1.Cells(Rows.Count, "A").End(xlUp).Row
For r = 2 To lr
ws2.[B1] = ws1.Cells(r, "B")
ws2.[B2] = ws1.Cells(r, "A")
ws2.[B3] = ws1.Cells(r, "C")
ws2.[B4] = ws1.Cells(r, "D")

ws2.Activate
ActiveSheet.PrintOut
Next r

End Sub
 
Solution

Prashant1211

New Member
Joined
Jun 9, 2020
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
Hi rpaulson
Thank you very much. It worked good. Only the problem i am facing now, when i try to save the Labels in PDF format. every time the loop run it ask for the path for next label. This i do not want, I want to give the file name and path in the starting and then all labels should be saved in one PDF file by self page by page. Is it really possible ?

Thanks again for you time and help :)
 

Watch MrExcel Video

Forum statistics

Threads
1,132,807
Messages
5,655,420
Members
418,198
Latest member
jad1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top