Dynamic print area

niall91

New Member
Joined
Jul 21, 2020
Messages
45
Office Version
  1. 2019
Platform
  1. Windows
Hi Guys

Having trouble setting a dynamic print area
trying to make this work
but keep coming up with a type mismatch error

VBA Code:
Sheets("sheets1").pagesetup.PrintArea = .Range(Cells(1,x),Cells(9, y))
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
oops :oops:
remove .Address

Bad
.Cells(14, setUpPage + 9)).Address

Good
.Cells(14, setUpPage + 9))
 
Upvote 0
Away from PC at the moment
Will look later and update thread then
 
Upvote 0
Hey

i got it to work (y)

VBA Code:
Cells(1, pagesetup).Resize(14, pagesetup + 9).Copy
Cells(1, pagesetup + 10).Select
ActiveSheet.Paste
 
Upvote 0

Forum statistics

Threads
1,215,516
Messages
6,125,285
Members
449,218
Latest member
Excel Master

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