• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Print button - specific cell range - multiple workbooks

Josh Hebert

New Member
I created a print button using 2 modules that need to exist in multiple workbooks.

When I created the button using the module in the original workbook, it was fine.

When I create a new workbook using "Save As", and rename as a new workbook, the print button always brings up the original workbook when I use it.

Can I alter the code on the module to only refer to the active sheet the button exists within?

The 2 buttons have the code listed as follows:

>>> use code - tags <<<
Code:
Sub PrintSomeCells()
Range("A2:Y45").PrintOut
End Sub
and

Code:
Sub PrintSomeCells()
Range("Z2:AX45").PrintOut
End Sub
 
Last edited by a moderator:
Josh Hebert
Have You checked where is Your button linked?
You can select Macros in: This Workbook to make sure that You'll use This Workbook's macros.
Screenshot 2021-05-21 at 22.04.40.png
 
Back
Top