I have a table where I insert data and I want to print it. The table is set to 195 pages because I have to cover the entire area I need, but I want control a certain area, not the whole area, so let's say the data is only filled and can be printed on 5 pages. I have the code on VBA = >
Sub printValue()
ActiveSheet.PageSetup.PrintArea = Range("A2:CLQ41", Range("A2:CLQ41").End(xlDown)).Address
ActiveWindow.SelectedSheets.PrintOut
End Sub
but this code is print still all 195 pages, and I want it to print only the pages that contain some info in the table and ignore 0's.I can do them blank is not problem, but the table also has a header so it still go for full 195 pages, see the image below. Is this possible via VBA? Anyone can help?


xlDownends up at the very last row,CLQ1048576? I'd add an error handler, or doxlUpfrom the last row (e.g.Range("A2:CLQ1048576").End(xlUp)?