Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Formating


I am trying to write a macro that will look at a cell in one workshee
to determine the fill color of a specified range on an othe
worksheet.

example:
if cell A1 in sheet1 = 0 then the fill color for sheet2 cells b2:d
will be red.

Thank

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Cell Formating

Hi,

One way without a macro, is to use Conditional formatting on Sheet2, cells B2:D2 with a formula like
=nCell=0
where nCell is a named reference to Sheet1, A1.

HTH
Anders Silvén

"MWilliams" skrev i meddelandet ...

I am trying to write a macro that will look at a cell in one worksheet
to determine the fill color of a specified range on an other
worksheet.

example:
if cell A1 in sheet1 = 0 then the fill color for sheet2 cells b2:d2
will be red.

Thanks


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Formating


If worksheets("Sheet1").range("a1").value = 0 then
with worksheets("sheet2").range("b2:d2").Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
end with

end if

if sheets are in different workbooks add worbooks("name"). befo
worksheets("sheet?")

eg

workbooks("name").worksheets("Sheet1").range("a1

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cell Formating

I think you mean:

If worksheets("Sheet1").range("a1").value = 0 then
with worksheets("sheet2").range("b2:d2").Interior
.ColorIndex = 3
.Pattern = xlSolid
. PatternColorIndex = xlAutomatic
end with

end if


--
Regards,
Tom Ogilvy

"mudraker" wrote in message
...

If worksheets("Sheet1").range("a1").value = 0 then
with worksheets("sheet2").range("b2:d2").Interior
ColorIndex = 3
Pattern = xlSolid
PatternColorIndex = xlAutomatic
end with

end if

if sheets are in different workbooks add worbooks("name"). befor
worksheets("sheet?")

eg

workbooks("name").worksheets("Sheet1").range("a1"


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



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
Need help with formating cell Bandit Excel Discussion (Misc queries) 4 August 12th 11 06:16 PM
need help formating a cell Rama Excel Worksheet Functions 3 July 22nd 08 04:14 PM
Cell Formating chiefwidmer Excel Discussion (Misc queries) 2 September 18th 07 11:25 PM
Cell to follow content AND/OR formating of another cell 0-0 Wai Wai ^-^ Excel Discussion (Misc queries) 1 September 8th 05 02:00 PM
CELL FORMATING thom kamp Excel Discussion (Misc queries) 1 February 22nd 05 05:55 AM


All times are GMT +1. The time now is 01:15 PM.

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"