When you set the Print Area (File>PageSetup>Sheet Tab), Excel creates a Name called Print_Area. It doesn’t appear to be any more complicated than that because you can create that Name manually and get the same effect. That leaves two ways to set the Print Area in VBA, by accessing the PageSetup object and by accessing the Names collection object.
Sheet1.PageSetup.PrintArea = “A1:F15?
Sheet1.Names.Add “Print_Area”, Sheet1.Range(“A1:F15?)
To remove the Print Area, you again have two options. Using the PageSetup object, set the PrintArea property to an empty string. For Names, use the Delete method. If the Name doesn’t exist, VBA will raise an error, so it’s best to use some error checking for that method.
Sheet1.PageSetup.PrintArea = “” ’empty string
On Error Resume Next
On Error GoTo 0