Conditional Formatting

  • Thread starter Thread starter Michael Rekas
  • Start date Start date
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
 
Have you isolated the issue to the conditional formatting?

NO - Then do so. Perhaps run the code and at the end of the code, delete the
conditional formatting. Then print. If no error, you've essentially isolated
the issue.

YES - Well, your only hope is someone has seen this and opened a ticket with
MS and had it resolved. Your company MSDN administrator could open a ticket
if you have that support level. If not, you may be able to open one youself,
but it costs $.

Other thing you could try - run the code. save. close. reopen. print.
perhaps that will work and help further isolate the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top