M
Michael Rekas
Hi there
My macro generates a Sales by Product by Customer PivotTable with 3
columns i.e. Product, Customer and Total.
Automatic subtotal are generated at each change of Product (Column A)
I then insert the following Conditional Format in the entire
PivotTable range which makes it look great.
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(RIGHT($A1,5)=""Total"",1,0)"
Selection.FormatConditions(1).Font.Bold = True
Selection.FormatConditions(1).Borders(xlLeft).LineStyle =xlContinuous
Selection.FormatConditions(1).Borders(xlRight).LineStyle=xlContinuous
Selection.FormatConditions(1).Borders(xlTop).LineStyle = xlContinuous
Selection.FormatConditions(1).Borders(xlBottom).LineStyle =
xlContinuous
Selection.FormatConditions(1).Interior.ColorIndex = 15
As I said, it looks good on screen and in Print Preview.
However when I click on Print, message "EXCEL.exe has generated
errors and will be closed by Windows". I have tried on different PCs
as well as with different printers.
I am using Excel 2000.
Any way to resolve this or track why this is happening?
Thanks
Michael
My macro generates a Sales by Product by Customer PivotTable with 3
columns i.e. Product, Customer and Total.
Automatic subtotal are generated at each change of Product (Column A)
I then insert the following Conditional Format in the entire
PivotTable range which makes it look great.
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(RIGHT($A1,5)=""Total"",1,0)"
Selection.FormatConditions(1).Font.Bold = True
Selection.FormatConditions(1).Borders(xlLeft).LineStyle =xlContinuous
Selection.FormatConditions(1).Borders(xlRight).LineStyle=xlContinuous
Selection.FormatConditions(1).Borders(xlTop).LineStyle = xlContinuous
Selection.FormatConditions(1).Borders(xlBottom).LineStyle =
xlContinuous
Selection.FormatConditions(1).Interior.ColorIndex = 15
As I said, it looks good on screen and in Print Preview.
However when I click on Print, message "EXCEL.exe has generated
errors and will be closed by Windows". I have tried on different PCs
as well as with different printers.
I am using Excel 2000.
Any way to resolve this or track why this is happening?
Thanks
Michael