B
BEEJAY
Have used the following for a number years (Thanks to Frank Kabel)
However, as the pricing sheets get larger (now about 1500 lines), it is
taking too long from start to finish. This particular process takes about 1
full minute.
The area of concern in the coding shown is between the >>>>>>>>>>>
Any ideas/suggestions would be greatly appreciated
Sub PrintPricingCustomer()
' PrintPricingCustomer Macro
' Keyboard Shortcut: NONE
Worksheets("Pricing").Select
Call WS_Unprotect
Application.ScreenUpdating = False
Cells.Select
With Selection
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
.Interior.ColorIndex = -4142
End With
With ActiveSheet.PageSetup
.PrintGridlines = False
.CenterHorizontally = True
End With
Cells.Select
With Selection
.EntireRow.Hidden = False
.EntireColumn.Hidden = False
End WithDim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "B").Value = "x" Then
Rows(RowNdx).Hidden = True
End If
Next RowNdx
Columns("F:G").Select
Selection.EntireColumn.Hidden = True
Worksheets("Pricing").PrintOut Copies:=1, Collate:=True
Call Green
Call WS_Protect
Application.ScreenUpdating = True
End Sub
However, as the pricing sheets get larger (now about 1500 lines), it is
taking too long from start to finish. This particular process takes about 1
full minute.
The area of concern in the coding shown is between the >>>>>>>>>>>
Any ideas/suggestions would be greatly appreciated
Sub PrintPricingCustomer()
' PrintPricingCustomer Macro
' Keyboard Shortcut: NONE
Worksheets("Pricing").Select
Call WS_Unprotect
Application.ScreenUpdating = False
Cells.Select
With Selection
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
.Interior.ColorIndex = -4142
End With
With ActiveSheet.PageSetup
.PrintGridlines = False
.CenterHorizontally = True
End With
Cells.Select
With Selection
.EntireRow.Hidden = False
.EntireColumn.Hidden = False
End WithDim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "B").Value = "x" Then
Rows(RowNdx).Hidden = True
End If
Next RowNdx
Columns("F:G").Select
Selection.EntireColumn.Hidden = True
Worksheets("Pricing").PrintOut Copies:=1, Collate:=True
Call Green
Call WS_Protect
Application.ScreenUpdating = True
End Sub