Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
kwkhoo
 
Posts: n/a
Default conditional formatting on specific text in cells

hi i have a problem

i want to do the following:

a b c d e f g h
1 3 3 3 3-3-3 3 4 5 3-4-5

d1 has formula =a1&"-"&a2&"-"&a3 to combine cells a1 to c1 to get 3-3-3
d2 has formula =e1&"-"&f2&"-"&g3 to combine cells e1 to g1 to get 3-4-5

how can i make the digit "4" and "5" be colored red to reflect the
changes from 3-3-3 to 3-4-5?

secondly, using the table above (perhaps related)

if i apply conditional formatting to cell g1, and it turns red
and i apply the formula "=g1" to a new cell I2 , it only shows the
value, but not the red color.
how do it get it to show red color in I2

i'm close to pulling my hair out. banging on the wall don't help.

thanks!

  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

1) Conditional formatting cannot change the color of parts of strings. You
could use a worksheet calculate event, but that would also require the use
of two 'helper' cells.

2) Conditional formatting only applies to the cell which it is added to. If
you want I2 to change the same way as G2, then you need to use the same
conditional formatting on cell I2 as on G2.

i'm close to pulling my hair out. banging on the wall don't help.


It only helps if you bang the bald spot on your head (from pullin your hair
out) on the wall.

HTH,
Bernie
MS Excel MVP


"kwkhoo" wrote in message
ups.com...
hi i have a problem

i want to do the following:

a b c d e f g h
1 3 3 3 3-3-3 3 4 5 3-4-5

d1 has formula =a1&"-"&a2&"-"&a3 to combine cells a1 to c1 to get 3-3-3
d2 has formula =e1&"-"&f2&"-"&g3 to combine cells e1 to g1 to get 3-4-5

how can i make the digit "4" and "5" be colored red to reflect the
changes from 3-3-3 to 3-4-5?

secondly, using the table above (perhaps related)

if i apply conditional formatting to cell g1, and it turns red
and i apply the formula "=g1" to a new cell I2 , it only shows the
value, but not the red color.
how do it get it to show red color in I2

i'm close to pulling my hair out. banging on the wall don't help.

thanks!



  #3   Report Post  
kwkhoo
 
Posts: n/a
Default

understood. thanks bernie

1) what if i convert the formulas into values? will it help?

i have converted the H1 cell to a value of "3-4-5" and D1 cell to
"3-3-3", i've got bits and pieces of codes here, (thanks ya all) but i
don't know how to compile them into one nice macro due to my lack of vb
skills

it's goes along like,
if e1a1, then Left(H1,1) = red, else do nothing
if f1b1, then mid(H1,3,1) = red, else do nothing
if g1c1, then right(H1,1) = red, else do nothing

this is what i found to color it red and bold:

Function SECTORA()

With ActiveCell.Characters(Start:=1, Length:=1).Font
.ColorIndex = 3
.Bold = True

End With

End Function

2) so you mean even if i color my text first using conditional format
in G2, there's no way to "copy the colors" without doing a conditional
format.

  #4   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

1) Below is code that will accomplish #1

2) Yes. Though you could copy cell G2, then pastespecial formats onto other
cells.

HTH,
Bernie
MS Excel MVP


Sub TryNow()
Dim i As Integer

Range("D1").Value = Range("D1").Value
Range("H1").Value = Range("H1").Value
For i = 1 To Len(Range("D1").Value)
If Mid(Range("D1").Value, i, 1) < Mid(Range("H1").Value, i, 1) Then
With Range("D1").Characters(Start:=i, Length:=1).Font
.ColorIndex = 3
.Bold = True
End With
With Range("H1").Characters(Start:=i, Length:=1).Font
.ColorIndex = 3
.Bold = True
End With
End If
Next i

End Sub


"kwkhoo" wrote in message
ups.com...
understood. thanks bernie

1) what if i convert the formulas into values? will it help?

i have converted the H1 cell to a value of "3-4-5" and D1 cell to
"3-3-3", i've got bits and pieces of codes here, (thanks ya all) but i
don't know how to compile them into one nice macro due to my lack of vb
skills

it's goes along like,
if e1a1, then Left(H1,1) = red, else do nothing
if f1b1, then mid(H1,3,1) = red, else do nothing
if g1c1, then right(H1,1) = red, else do nothing

this is what i found to color it red and bold:

Function SECTORA()

With ActiveCell.Characters(Start:=1, Length:=1).Font
.ColorIndex = 3
.Bold = True

End With

End Function

2) so you mean even if i color my text first using conditional format
in G2, there's no way to "copy the colors" without doing a conditional
format.



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
Conditional formatting applicable to entire column jackalx Excel Worksheet Functions 1 May 26th 05 05:20 PM
Copying conditional formatting...HELP PLEASE!!!! trixiebme Excel Worksheet Functions 3 March 24th 05 01:53 PM
Conditional formatting based on text Gilles Desjardins Excel Worksheet Functions 8 February 16th 05 10:45 PM
bolding cells in conditional formatting Katherine Excel Worksheet Functions 1 December 7th 04 07:57 PM
conditional formating - Highlighting text cells based on sales res ANDREW_B Excel Discussion (Misc queries) 7 December 2nd 04 04:27 PM


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