Forum Discussion
QTr90
Jul 11, 2023Copper Contributor
Printing all the tabs in excel separately
Hi everyone, I'm using excel 365 version. I got the problem with my report file. The file contains multiple sheets, each sheet contains the transaction of 1 customer. When printing the report of ...
HansVogelaar
Jul 11, 2023MVP
See if running this macro works for you:
Sub PrintSheets()
Dim wsh As Worksheet
For Each wsh In Worksheets
wsh.PrintOut
Next wsh
End SubQTr90
Jul 17, 2023Copper Contributor
HansVogelaar I'm so sorry for bother again, but can you check if i wrote the marco correctly?. I'm using power query to generate the report in each sheet, and print only some particular sheets contains transactions data of these customers in a day, not the entire workbook:
Sub Printsheet()
Dim wsh As Worksheet
For Each wsh In Worksheets
If Range("A9").Value = 1 Or Range("A9").Value = "Paysend" Then
wsh.PrintOut
End If
Next wsh
End Sub
- HansVogelaarJul 17, 2023MVP
Almost, but Range("A9").Value refers to the active sheet, not on wsh. Change the macro to
Sub Printsheet() Dim wsh As Worksheet For Each wsh In Worksheets If wsh.Range("A9").Value = 1 Or wsh.Range("A9").Value = "Paysend" Then wsh.PrintOut End If Next wsh End Subcell A9 on