LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 172
Default conditional format rage based on entries within range

Hi Don,
Thanks.
I have no idea what the code means but it works.
The only time the cells don't revert back to red if the range is empty is
when two or more cells are selected at the same time and the data is deleted
en mass rather than one cell at a time, in this instance the now empty range
remains un formatted - certainly not the end of the world for me, as once the
data is entered there should be no need to delete it, but thtought you might
be interested. Also, as with all novices' I haven't given the complete
picture - there are other cell ranges in the spreadsheet that I would like
formatting to different colours depending on whether the range is blank or
not, I tryed to duplicate your formula below the origonal I had entered but
excel returned an error and (don't mean to be greedy), is there anything I
can add to your code to repeat the command down the columns of the data range
for a (monthly) list of varying length. Or should I stick to looking for a
conditional format solution?
Cheers.
Simon.

"Don Guillett" wrote:

Instead of CF try this worksheet change event that will color if all TRULY
blank
Right click sheet tabview codeinsert this
'--------
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myrange As Range
Set myrange = Range("b1:d4")
If Intersect(Target, myrange) Is Nothing Then Exit Sub
If Target.Count 1 Then Exit Sub
If Len(Application.Trim(Target)) < 1 Then
Application.EnableEvents = False
Target = ""
Application.EnableEvents = True
End If
If Application.CountA(myrange) = 0 Then
myrange.Interior.ColorIndex = 3
Else
myrange.Interior.ColorIndex = -4142
End If
End Sub
'=======
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Simon" wrote in message
...
I have a spreadsheet in excel 2003 where a range of cells contain different
text.

If there is no text in any of the cells within the range I would like the
range conditionally formated (red), however if any or all of the cells
within
the range contain text then no format should be applied;e.g.

If A1 to D1 are blank format cells red, when text is entered into B1
remove
formatting.

All help greatly recieved.
Simon.


.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Format for one cell based on range Sandy82 Excel Worksheet Functions 3 August 8th 08 06:05 PM
How to conditional format columns in a range based on BlyChris Excel Worksheet Functions 5 July 25th 08 06:10 AM
Conditional format a cell based on another range of cells ked Excel Worksheet Functions 4 January 9th 07 06:44 PM
Conditional Format based on range Dave Excel Discussion (Misc queries) 3 June 5th 06 06:15 AM
Need help with a formula for calculating based on a rage of dates djeans Excel Discussion (Misc queries) 7 July 2nd 05 09:06 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"