Forum Statistics
- Forum Members:
- Total Threads:
- Total Posts: 14
There are 1 users currently browsing forums.
|
 |

12-05-2009, 09:37 AM
|
|
Registered User
|
|
Join Date: 03 Nov 2008
Location: India
MS Office Version:Totally Confused with 2007
Posts: 397
|
|
|
Does Conditional Formatting apply to each Character in a Cell?
Please Register to Remove these Ads
Dear Forum,
I am trying to do a very simple Task of employing conditional Formatting in a Cell $B$2 which contains the following letters i.e characters.. [ A B C D E ]
They are coloured as follows :
A B C D E and this cell is filled with BLACK Fill Colour
Now If I enter 1 in the Cell $A$2, then the same colour scheme should remain in the Cell $B$2 but if I enter 2 then the formatting should change to BLUE FIll Colour and the Text to Yellow...
But when I tried changing the value in the Cell A2 to 2 , then only the first letter i.e "A" changes to Yellow Colour while rest does not change its colour i.e. remain the same...
Why is the entire cell B2 not getting formatted with all the contents?
And what is the remedy for the same?
Warm Regards
e4excel
Last edited by e4excel; 12-05-2009 at 01:58 PM.
Reason: Spelling Mistakes
|

12-05-2009, 06:24 PM
|
 |
Forum Moderator
|
|
Join Date: 28 Oct 2008
Location: German in New Zealand
MS Office Version:2000 - 2010
Posts: 4,673
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
I assume that A is formatted with the default cell's formatting, and the other letters are formatted individually in the formula editing box.
Conditional formatting will only cange the default format of a cell, so the individual color formats you have set manually for the other letters will override CF.
hth
|

12-06-2009, 02:20 PM
|
|
Registered User
|
|
Join Date: 03 Nov 2008
Location: India
MS Office Version:Totally Confused with 2007
Posts: 397
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
Quote:
Originally Posted by teylyn
I assume that A is formatted with the default cell's formatting, and the other letters are formatted individually in the formula editing box.
|
I have formatted individually to "purple" colour so when there's 1 in F1 "A" remains the same i.e Purple however when I cahnge the value F1=2 then only "A" changes to Blue while rest of the Letters BCDE reamin unchanged..
Quote:
Conditional formatting will only cange the default format of a cell, so the individual color formats you have set manually for the other letters will override CF.
|
Is there a way of overriding the same or an you suggest a workaround...
|

12-06-2009, 02:34 PM
|
 |
Forum Moderator
|
|
Join Date: 28 Oct 2008
Location: German in New Zealand
MS Office Version:2000 - 2010
Posts: 4,673
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
Unless you want to involve VBA, there is probably no native Excel solution for this.
My suggestion is to split the different colored elements out into separate columns, use the default formatting to format each cell and apply conditional formatting to change it.
hth
|

12-06-2009, 02:58 PM
|
|
Registered User
|
|
Join Date: 03 Nov 2008
Location: India
MS Office Version:Totally Confused with 2007
Posts: 397
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
Ok thanks a lot Tevelyn got my answer that its not possible in Excel as I was unsure about that...!
However if were to involve VBA , can you please add an attachment for the same..
I had though of bifurcating the characters in Multiple cells but as per the existing design of the present workbook it won't be feasible..
Would appreciate if you could come up with something via VBA which is not my CUp of Tea at all..
Please provide explantions wherever neccessary as I do not get VBA very easily but off late have started using it more frequently with the Forum's help...
Thanks a lot for the confirmation ANyways..
|

12-06-2009, 03:04 PM
|
 |
Forum Moderator
|
|
Join Date: 28 Oct 2008
Location: German in New Zealand
MS Office Version:2000 - 2010
Posts: 4,673
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
Quote:
|
can you please add an attachment for the same
|
Sorry, my VBA is too basic to do stuff like that. Maybe start a new thread in the programming forum and explain that you want to programatically format parts of a text string based on conditions.
hth
|

12-07-2009, 01:26 AM
|
|
Forum Moderator
|
|
Join Date: 30 Mar 2007
Location: Davis CA
MS Office Version:Excel 2004
Posts: 2,322
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
You could put this in the sheet's code module.
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim i As Long
If Not Application.Intersect(Target, Range("A2:B2")) Is Nothing Then
Application.EnableEvents = False
Application.ScreenUpdating = False
With Range("B2")
If Val(CStr(Range("A2").Value)) <> 2 Then
For i = 1 To .Characters.Count
With .Characters(i, 1)
Select Case .Text
Case "A"
.Font.Bold = True
.Font.ColorIndex = 54
Case "B"
.Font.Bold = True
.Font.ColorIndex = 3
Case "C"
.Font.Bold = True
.Font.ColorIndex = 44
Case "D"
.Font.Bold = True
.Font.ColorIndex = 13
Case "E"
.Font.Bold = True
.Font.ColorIndex = 14
Case Else
.Font.Bold = False
.Font.ColorIndex = xlAutomatic
End Select
End With
Next i
.Interior.ColorIndex = 1
Else
For i = 1 To .Characters.Count
With .Characters(i, 1)
.Font.Bold = False
.Font.ColorIndex = 6
End With
Next i
.Interior.ColorIndex = 5
End If
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
End If
End Sub
|

12-07-2009, 04:28 AM
|
|
Registered User
|
|
Join Date: 03 Nov 2008
Location: India
MS Office Version:Totally Confused with 2007
Posts: 397
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
Dear Mick,
I have tried using your code in my file but I am not sure whether am I using it correctly as Im no good in VBA.
Nothings happening as in there's nothing new happening..
I wil attach the file you can check and let me know...
Thanks..
|

12-07-2009, 04:57 AM
|
 |
Forum Guru
|
|
Join Date: 11 Dec 2005
Location: Moruya, Australia
MS Office Version:2007
Posts: 1,548
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
mike is off line but
place the code in the "VBAProject" "Microsoft Excel Objects" "sheet1"
click on the work sheet1 and place the code
(same as you have done in module1)
__________________
.
regards pike
Always add code tags to your VBA script [code] .Range("A1:A10").RemoveDuplicates [/code]
Code:
.Range("A1:A10").RemoveDuplicates Columns:=Array(1, 2), Header:=xlYes
Remember to change the prefix to [SOLVED] If the solution helped and you wish to add to the contributors reputation, click the.... .... icon in top right hand corner of the thread ......... ã Spreadsheet Toolbox
|

12-07-2009, 08:41 AM
|
|
Registered User
|
|
Join Date: 03 Nov 2008
Location: India
MS Office Version:Totally Confused with 2007
Posts: 397
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
Dear Pike,
Thanks for the update, I knew that I was doing something wrong but am not good enough to even know that in VBA..
However, though its working it turns completely blue after I enter 2 in A2 and does not show any text in B2..Please tell me what am i supposed to do about that?
Just had a very quicjk question how many colours are there in Excel available to format..?
|

12-07-2009, 02:59 PM
|
 |
Forum Moderator
|
|
Join Date: 28 Oct 2008
Location: German in New Zealand
MS Office Version:2000 - 2010
Posts: 4,673
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
Quote:
|
how many colours are there in Excel available to format
|
56 in Excel 2003, but you can change the default color palette. Gazillions in 2007.
|

12-08-2009, 12:27 AM
|
|
Registered User
|
|
Join Date: 03 Nov 2008
Location: India
MS Office Version:Totally Confused with 2007
Posts: 397
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
Quote:
Originally Posted by teylyn
56 in Excel 2003, but you can change the default color palette. Gazillions in 2007.
|
Thanks Tevelyn,
I was not sure about the range, anyways I use 2003 I would be limited to 56..
Dear Forum,
If someone can check the attachemnt and lemme know as to what changes I need to make then it would be great..!
Regards
|

12-08-2009, 09:22 AM
|
|
Forum Moderator
|
|
Join Date: 30 Mar 2007
Location: Davis CA
MS Office Version:Excel 2004
Posts: 2,322
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
Putting the code in the Sheet1 code module and removing the CF from B2 should fix things.
Last edited by mikerickson; 12-08-2009 at 10:27 AM.
|

12-08-2009, 11:35 AM
|
 |
Forum Guru
|
|
Join Date: 05 Mar 2008
Location: Virginia, US
MS Office Version:2007
Posts: 1,679
|
|
|
Re: Does Conditional Formatting apply to each Character in a Cell?
Quote:
Originally Posted by teylyn
Gazillions in 2007.
|
Technically, only 16,777,216. Each of the three main colors has 256 shades recognized, so it's 256^3. Don't really know why they have so many, though. I think it's one of those changes they made more because they could than because people demanded millions of colors.
|
 |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|