79612213

Date: 2025-05-08 10:57:07
Score: 1
Natty:
Report link

You might need to specify .EntireRow or .EntireColumn for VB to know which to create. Also the range A2:M33 might not give you what you want, as a page break is either horizontal or vertical, try:

Worksheets("Stack").Range("M33").EntireRow.PageBreak = xlPageBreakManual

If what you are trying to do is set the page printarea you should instead write:

Worksheets("Stack").PageSetup.PrintArea = "A2:M33"
Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Anders Christensen