Using Macro Button to Change Print Area & Print out

nathanthomson11

New Member
Joined
Apr 4, 2019
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Good morning, I have a tracking file which automatically creates a new barcode each time a new line item is added. The barcodes are created in column 'BE' using the '3 of 9 Barcode' font. Beside each barcode in column 'BD' is a 'Print' button which I would like to be able to click and it will only print the barcode directly to the right. For example, someone enters a new line item on line 3456 a barcode is automatically created on 'BD3456 and a button exists on 'BE3456 which when pressed, would automatically change the print area to 'BD3456 and print the barcode.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I'm not sure how to do it with the button, but here is another option to think about.

After you generate the bar code, just use the same procedure to write the word "PRINT" in the cell to the right, in this case cell BE3456. Use the Worksheet_Change event procedure to check to see if the target cell contains the word "PRINT", and if so, then change the print range to the single cell one cell to the left.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

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
Back
Top