K
Karl Irvin
I have a worksheet (named Print) that lists the names of the worksheets in a
workbook that I need to print. I'm not printing all the work sheets and I
need to print them in a different order than tthe tabs at the the bottom of
the screen. I need to be able to change the list of the worksheets to be
printed as needed.
My code is working except that it doesn't print the worksheets in the order
they are listed on the worksheet.
The worksheet name Print list the worksheets to be printed in the following
order.
Cover
Assets
Liabilities
PL MoYtd
CF MoYtd
The sheet name Liabilites prints after the sheet named PL MoYtd instead of
before it.
The code is: --------------------------------
Public Sub PrintSheets()
Dim ActiveSh As Worksheet
Dim cell As Object
Dim ShNameView As String
Set ActiveSh = ActiveSheet
Application.ScreenUpdating = False
For Each cell In Worksheets("Print").Range(Range("A2"),
Range("A2").End(xlDown))
ShNameView = cell.Value
Sheets(ShNameView).Select
ActiveWindow.SelectedSheets.PrintOut copies:=1
Next
ActiveSh.Select
Application.ScreenUpdating = True
End Sub
----------------------------------------------
Is there anything I can change to get the sheets to print in the order
listed?
Thanks
workbook that I need to print. I'm not printing all the work sheets and I
need to print them in a different order than tthe tabs at the the bottom of
the screen. I need to be able to change the list of the worksheets to be
printed as needed.
My code is working except that it doesn't print the worksheets in the order
they are listed on the worksheet.
The worksheet name Print list the worksheets to be printed in the following
order.
Cover
Assets
Liabilities
PL MoYtd
CF MoYtd
The sheet name Liabilites prints after the sheet named PL MoYtd instead of
before it.
The code is: --------------------------------
Public Sub PrintSheets()
Dim ActiveSh As Worksheet
Dim cell As Object
Dim ShNameView As String
Set ActiveSh = ActiveSheet
Application.ScreenUpdating = False
For Each cell In Worksheets("Print").Range(Range("A2"),
Range("A2").End(xlDown))
ShNameView = cell.Value
Sheets(ShNameView).Select
ActiveWindow.SelectedSheets.PrintOut copies:=1
Next
ActiveSh.Select
Application.ScreenUpdating = True
End Sub
----------------------------------------------
Is there anything I can change to get the sheets to print in the order
listed?
Thanks