Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Macro in Excel

Status
Not open for further replies.

dpgirl

Technical User
Apr 5, 2005
45
US
I would like to be able to do some conditional formatting in Excel, but I'd like to do it through a Macro since this will give me the flexibility to have as many conditional statements as I want. Can someone help me with the VB script?

Here is what I want to do through the macro.

1) Look at all values in column D
2) If any of the values equals "John", then shade the corresponding cell blue.
3) If any of the values equals "Mary", then shade the corresponding cell red.

Thanks!
 

Since this question relates to Excel VBA, and this is the VB6 forum, try reposting in forum707

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top