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

Does anyone know if you can write a macro in Excel that will result in
certain cells being colored in if a specific condition exists? I know you can
write for the condition, but can the product actually go out and color a
specific cell say red if the correct condition exists?
Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel Macros

You don't need a macro, you can do that with Conditional Formatting
(FormatConditional Formatting)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Nonsequitr" wrote in message
...
Does anyone know if you can write a macro in Excel that will result in
certain cells being colored in if a specific condition exists? I know you

can
write for the condition, but can the product actually go out and color a
specific cell say red if the correct condition exists?
Thanks,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Excel Macros

Non,

Sure. Here's some example code.

If Range("A1").Value = "Fred" Then
Range("A3").Interior.ColorIndex = 3
Else
Range("A3").Interior.ColorIndex = xlNone
End If

Typically, that would be used in the worksheet's change event so that when
A1 is changed, the color of A3 is then automatically changed. As an event,
it could be written exactly the same, just wrapped in the event sub.

HTH,
Bernie
MS Excel MVP

"Nonsequitr" wrote in message
...
Does anyone know if you can write a macro in Excel that will result in
certain cells being colored in if a specific condition exists? I know you

can
write for the condition, but can the product actually go out and color a
specific cell say red if the correct condition exists?
Thanks,



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Excel Macros

problem not clear. however use format-conditional formatting


Nonsequitr wrote in message
...
Does anyone know if you can write a macro in Excel that will result in
certain cells being colored in if a specific condition exists? I know you

can
write for the condition, but can the product actually go out and color a
specific cell say red if the correct condition exists?
Thanks,



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
Excel 2007 macros - how to merge 5 macros together into one Sue Excel Discussion (Misc queries) 1 April 16th 08 08:36 PM
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM
convert lotus 123w macros to excel macros rpiescik[_2_] Excel Programming 1 September 19th 04 12:41 PM
convert lotus 123w macros to excel macros rpiescik Excel Programming 1 September 18th 04 01:35 PM
Making excel macros run Word macros Matthew McManus Excel Programming 1 February 18th 04 02:57 AM


All times are GMT +1. The time now is 10:23 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"