Sub PrintWithoutWhiteText()
Application.EnableEvents = False
Dim LastColumn As Long
Dim LastRow As Long
Dim LastCell
LastRow = ActiveSheet.UsedRange.Rows.Count
LastColumn = ActiveSheet.UsedRange.Columns.Count
LastCell = Cells(LastRow, LastColumn).Address(False, False)
For Each c In Worksheets("Quote").Range("B1:" + LastCell).Cells
If c.Font.ColorIndex = 2 Then
c.NumberFormat = ";;;"
End If
Next
On Error GoTo ErrCatch
Application.Dialogs(xlDialogPrintPreview).Show
ErrCatch:
If Err.Number = 123 Then
For Each d In Worksheets("Quote").Range("B1:" + LastCell).Cells
If d.NumberFormat = ";;;" Then
d.NumberFormat = "#,##0"
End If
Next
Let Cells(1, 30).Value = 0
End If
For Each d In Worksheets("Quote").Range("B1:" + LastCell).Cells
If d.NumberFormat = ";;;" Then
d.NumberFormat = "#,##0"
End If
Next
Application.EnableEvents = True
End Sub
Bookmarks