Goal
To have a dynamic print range, stopping at the last visible row.
Column C
Contains non visible formulas.
The formulas start at row 17 and continue to row 200.
Sometimes these rows contains visible data and sometimes not.
Column D-L
Contains sometimes free text.
Problem
Can’t figure out how to change print area to last visible row.
Want to print out everything until the last visible row, even rows with no visible data.
But after last visible row, nothing should come out.
Script below working fine, except it displays all empty rows (which contains formulas).
Resulting all print jobs will have empty pages at the bottom with no visible data.
Using this print area script
Sub print area()
Dim LastRow As Long
LastRow = Range("C:L").SpecialCells(xlCellTypeLastCell).Row
ActiveSheet.PageSetup.printarea = "$C$1:$L$" & LastRow
End Sub
Help
Can anyone help me obtain the goal ?
To have a dynamic print range, stopping at the last visible row.
Column C
Contains non visible formulas.
The formulas start at row 17 and continue to row 200.
Sometimes these rows contains visible data and sometimes not.
Column D-L
Contains sometimes free text.
Problem
Can’t figure out how to change print area to last visible row.
Want to print out everything until the last visible row, even rows with no visible data.
But after last visible row, nothing should come out.
Script below working fine, except it displays all empty rows (which contains formulas).
Resulting all print jobs will have empty pages at the bottom with no visible data.
Using this print area script
Sub print area()
Dim LastRow As Long
LastRow = Range("C:L").SpecialCells(xlCellTypeLastCell).Row
ActiveSheet.PageSetup.printarea = "$C$1:$L$" & LastRow
End Sub
Help
Can anyone help me obtain the goal ?