PC Review


Reply
Thread Tools Rate Thread

conditional formatting to print

 
 
=?Utf-8?B?Q1YzMjM=?=
Guest
Posts: n/a
 
      24th Apr 2007
Hi Everyone,

Following is my code.

Range("F88").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=E88<1"
Selection.FormatConditions(1).Font.ColorIndex = 15
Selection.FormatConditions(1).Interior.ColorIndex = 15

This code is used more than once in the Sub. The preceding code will just
hide that error, but when I print the document, I can see the #NUM in black
instead of nothing at all.

Ideally, I'd like to make an if statement that if E88 is zero, simply shade
the cell, otherwise perform the formula. If not, how can I make it print the
way it looks on screen?

Thanks for your help!

 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      24th Apr 2007
When you print in black and white any color based effects are lost. I think
this approach is better:

If Range("E88").Value < 1 Then
Range("F88").NumberFormat = ";;;"
Else
Range("F88").NumberFormat = "#,##0_);(#,##0)"
End If

Change the second number format to what you want if necessary.

--
Jim
"CV323" <(E-Mail Removed)> wrote in message
news:0A68A687-730F-4416-BA16-(E-Mail Removed)...
| Hi Everyone,
|
| Following is my code.
|
| Range("F88").Select
| Selection.FormatConditions.Delete
| Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=E88<1"
| Selection.FormatConditions(1).Font.ColorIndex = 15
| Selection.FormatConditions(1).Interior.ColorIndex = 15
|
| This code is used more than once in the Sub. The preceding code will just
| hide that error, but when I print the document, I can see the #NUM in
black
| instead of nothing at all.
|
| Ideally, I'd like to make an if statement that if E88 is zero, simply
shade
| the cell, otherwise perform the formula. If not, how can I make it print
the
| way it looks on screen?
|
| Thanks for your help!
|


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Conditional Formatting through VBA works in print preview but nowhere else! Duane Hookom Microsoft Access Getting Started 1 30th Apr 2010 04:36 AM
Print Conditional Formatting Gitche Gumee Microsoft Access 3 5th Jun 2008 08:37 PM
Print conditional formatting Sherry Microsoft Excel Misc 3 2nd Jun 2008 10:04 PM
Failing to print fill colour of conditional formatting =?Utf-8?B?U2lsdmVyU3Rhcg==?= Microsoft Access Reports 1 11th Apr 2007 10:20 PM
Print cells that meet conditional formatting criteria =?Utf-8?B?Um91bmR5?= Microsoft Excel Misc 1 14th Dec 2004 12:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:52 PM.