Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default All cell contents within a range of cells turns white if Sheet1!A1 =1

If the return of Sheet1!A1 = 1, I need all fill, font and line colors
to turn white from A1:E10. If the value of Sheet1!A1 changes to 0,
all colors must return to normal. Does anyone have any thoughts on
this? Thanks for any suggestions.

Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default All cell contents within a range of cells turns white if Sheet1!A1 = 1

If your range to format is on Sheet1.............

Conditional Formatting

Select A1:E10

FormatCFFormula is: =$A$1=1 Format to suit

If range to format is on a sheet other than Sheet1

Select Sheet1!A1 and give it a name..............insertnamedefine

On other sheet select range A1:E10 and FormatCF

Formula is =myname=1 where myname is your defined name for Sheet1!A1


Gord Dibben MS Excel MVP

On Fri, 4 Dec 2009 16:22:04 -0800 (PST), Michael Lanier
wrote:

If the return of Sheet1!A1 = 1, I need all fill, font and line colors
to turn white from A1:E10. If the value of Sheet1!A1 changes to 0,
all colors must return to normal. Does anyone have any thoughts on
this? Thanks for any suggestions.

Michael


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default All cell contents within a range of cells turns white if Sheet1!A1 = 1

Copy this code to your worksheet code module:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Sheets("Sheet1").Range("A1:A10")
If Not Intersect(Target,rng) Is Nothing Then
If Sheets("Sheet1").Range("A1") = 1 Then
With rng
.Interior.ColorIndex = 2
.Font.ColorIndex = 2
.Borders.ColorIndex = 2
End With
End If
If Sheets("Sheet1").Range("A1") = 0 Then
With rng
.Interior.ColorIndex = xlNone
.Font.ColorIndex = xlAutomatic
.Borders.ColorIndex = xlAutomatic
End With
End If
End If
End Sub



"Michael Lanier" wrote in message
...
If the return of Sheet1!A1 = 1, I need all fill, font and line colors
to turn white from A1:E10. If the value of Sheet1!A1 changes to 0,
all colors must return to normal. Does anyone have any thoughts on
this? Thanks for any suggestions.

Michael



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default All cell contents within a range of cells turns white ifSheet1!A1 = 1

Thanks to you both for your help. I'll try things out over the
weekend.

Michael
Reply
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
Populate growing range of cells from Sheet1 to Sheet2 Brad New Users to Excel 10 July 23rd 09 08:32 AM
Create a Macro to Range Cells, from the contents of another Cell. Denis Lory Excel Programming 1 April 11th 08 10:16 AM
compare the contents of one range of cells with the contents of a. Dozy123 Excel Discussion (Misc queries) 1 January 24th 07 10:14 AM
How do I copy the contents of a range of text cells and paste into one cell? davfin Excel Discussion (Misc queries) 7 July 4th 06 08:16 AM
Adding contents of one cell to a range of cells. CLJinVA Excel Worksheet Functions 1 February 10th 05 10:19 PM


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

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

About Us

"It's about Microsoft Excel"