print number of copies based on the value of a cell on another sheet

TDS1990

New Member
Joined
Sep 16, 2021
Messages
1
Office Version
  1. 365
Platform
  1. MacOS
Hi, I wonder if anybody can help and thanks in advance to those who can provide any input :)

I work in a warehouse and have to print labels for hundreds of different kinds of bottles. Currently we have a "Label Print" button macro in place that takes all the necessary data on one worksheet and generates the label on another, before automatically sending it to print. The problem is, depending on which type of bottle we're printing the label forwe might need 5 labels or we might need 50, and as things stand we have to press the button for each label we need.

I've created an extra column in the data spreadsheet which calculates and shows the value of how many labels are needed for each bottle, but for the life of me I can't seem to get it to print the number of labels on one sheet based on the value of the cell on the main sheet.

Here's a screenshot on what i'm playing with so far...

Screenshot 2021-09-16 at 21.50.57.png
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

NoSparks

Well-known Member
Joined
Mar 15, 2013
Messages
1,478
Office Version
  1. 2010
Platform
  1. Windows
perhaps this to generate the labels on the second worksheet
VBA Code:
' for each row on ws
For x = fRw To lRw
    ' write the label to wsl column"AC" times
    For j = 1 To ws.Cells(x, 29).Value
        ' this is what to write
        wsl.Cells(2, 1).Value = ws.Cells(x, 15).Value
        wsl.Cells(3, 1).Value = ws.Cells(x, 1).Value
        wsl.Cells(4, 1).Value = ws.Cells(x, 27).Value
        wsl.Cells(3, 3).Value = ws.Cells(x, 16).Value & "mg"
        wsl.Cells(4, 3).Value = ws.Cells(x, 26).Value
    Next j  ' loop required for number of lables
Next x  ' loop to next row
'
 
Upvote 0

Forum statistics

Threads
1,186,806
Messages
5,959,902
Members
438,453
Latest member
NRG909

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