Thread: Macro Question
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Macro Question

If I had seen that requirement in your original post, I wouldn't have suggested
conditional formatting in xl2003 and below.

BTW, xl2007 allows lots more rules.



McCloudK wrote:

Conditional Formatting only allows 3 conditions.....I need over a dozen

"Dave Peterson" wrote:

If you're not using Format|Conditional formatting, you may want to use that
instead of a macro:

If you select the range first (M7:ck100)
then with M7 the activecell
format|Conditional formatting
formula is:
=countif(m7,"*b.s.*")0

And give it a pretty format.



McCloudK wrote:

I run the following macro commands and they work fine. It simply looks at the
cell and if it matches the text in this case B.S. it replaces it with B.S.
with the cell color coded in this case color 3. My question is that this
macro requires that the cell entry be B.S., how could I look at the cells
value as opposed to what's entered. I would prefer that the cell receive the
B.S. value by using a formula that picks up the B.S value. But the macro
below at this time simply sees the formula and not the value.

Any help would be greatly appreciated!

Range("M7:CK100").Select
Application.ReplaceFormat.Interior.ColorIndex = 3
Selection.Replace What:="B.S.", Replacement:="B.S.", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=True


--

Dave Peterson


--

Dave Peterson