Announcement

Collapse
No announcement yet.

VBA to set Dynamic Print Area

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • VBA to set Dynamic Print Area



    Sheet1 has data in columns A:L
    Need VBA to set rows dynamically for A3:L, based on last row with data in column C
    Some columns have formulas, need formulas ignored, only data

  • #2
    Maybe attach a sample workbook including formulas

    Comment


    • #3
      In the meantime, try this.
      Code:
      Sheets("Sheet1").PageSetUp.PrintArea = Range("A3:L" & Cells.Find("*", ,xlValues , , xlByRows, xlPrevious).Row).Address

      Comment


      • #4


        Formulas are just VLOOKUPs down to about row 1003

        In Worksheet module code above does nothing. In ThisWorkbook module it gives: Run-time error '9': Subscript out of range

        Comment

        Working...
        X