Maintain a Print Area even when rows or columns are deleted

lunbryd

New Member
Joined
Apr 12, 2019
Messages
2
I am looking to set up a Print Area on a sheet that will remain even when I delete columns. Currently my print area is A1:G24 and when I delete columns A and B, my print area becomes A1:E24. I would like to set up the print area so when columns within that range are deleted, the data that moves in from the columns outside that range now become part of the print area.

Thanks.
 

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
2,924
.
Paste this in the Sheet Level Module :

Code:
Option Explicit


Private Sub Worksheet_Change(ByVal Target As Range)
    Worksheets("Sheet1").PageSetup.PrintArea = "$A$1:$G$24"
End Sub
 

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,471
Try going to the Name Manager and changing the "Refers to:" of your print area from =Sheet1!$A$1:$G$24 to =INDIRECT("Sheet1!$A$1:$G$24")
 

lunbryd

New Member
Joined
Apr 12, 2019
Messages
2
.
Paste this in the Sheet Level Module :

Code:
Option Explicit


Private Sub Worksheet_Change(ByVal Target As Range)
    Worksheets("Sheet1").PageSetup.PrintArea = "$A$1:$G$24"
End Sub
Try going to the Name Manager and changing the "Refers to:" of your print area from =Sheet1!$A$1:$G$24 to =INDIRECT("Sheet1!$A$1:$G$24")


These both worked for me. Thanks, guys.
 

Forum statistics

Threads
1,082,139
Messages
5,363,353
Members
400,729
Latest member
Lisa McConachy

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top