Hello guys, I have recently solved 1 problem here and I have another :D. Is it possible to make task manager in macro, which would ask which specific sheets to print? I have 10 sheets and there will be certainly times when I will use only for example first 3 of them. So to eliminate manual editing of macro (inserting which sheets to print by name) or to avoid unnecessary printing of all unused sheets. I would like to have pop up window, to which i would enter number of needed sheets. For example, the easiest way I guess would be set up the position number of last wanted sheet ( 3 =print first 3 sheets).
Here is the code which is working, but it prints all sheets except the first one which is used as summary.
I know there will be needed link between something like :
On Error Resume Next
resp = Application.InputBox(Prompt:="Insert number of desired sheets to print:", _
Title:="Total number of printed sheets", Type:=1) used from my another found out macro :D
number of Printout = resp ........or something like that, I am noob in VBA. I just have some basics in R software :D.
I sincerely thank you all for your time and aswers and I wish you a wonderful rest of the day.
Morty
Here is the code which is working, but it prints all sheets except the first one which is used as summary.
VBA Code:
Sub print()
'UpdatebyExtendoffice20161031
Dim xWs As Worksheet
Application.ScreenUpdating = False
For Each xWs In ThisWorkbook.Worksheets
If xWs.Visible = True Then
If xWs.Name <> "Summary" Then
With xWs.PageSetup
.PrintArea = "A1:K48" ' USE YOUR PRINTAREA
.Zoom = False
.FitToPagesTall = 1
.FitToPagesWide = 1
End With
xWs.PrintOut
End If
End If
Next xWs
Application.ScreenUpdating = False
MsgBox "Sheet “Summary” has not been printed", vbInformation, "Kutools for Excel"
End Sub
I know there will be needed link between something like :
On Error Resume Next
resp = Application.InputBox(Prompt:="Insert number of desired sheets to print:", _
Title:="Total number of printed sheets", Type:=1) used from my another found out macro :D
number of Printout = resp ........or something like that, I am noob in VBA. I just have some basics in R software :D.
I sincerely thank you all for your time and aswers and I wish you a wonderful rest of the day.
Morty