![]() |
conditional formatting only applies to part of cell text
I only want the condtional formatting to apply to the part of the text that
equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. |
conditional formatting only applies to part of cell text
That would require VBA coding. Theres no way to do that with the normal
conditional formatting that excel gives you. "klkropf" wrote: I only want the condtional formatting to apply to the part of the text that equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. |
conditional formatting only applies to part of cell text
Do you know what the VBA code would be?
"akphidelt" wrote: That would require VBA coding. Theres no way to do that with the normal conditional formatting that excel gives you. "klkropf" wrote: I only want the condtional formatting to apply to the part of the text that equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. |
conditional formatting only applies to part of cell text
to be honest I've never done this before so I really do not know. I imagine
you would have to loop through the range of cells everytime, search the cell for the given word you want using StrComp or something, then some how select the word within the sentence using some kind of find and range formulas and then change the color to whatever you want. It's possible but I'm not the man for the answer "klkropf" wrote: Do you know what the VBA code would be? "akphidelt" wrote: That would require VBA coding. Theres no way to do that with the normal conditional formatting that excel gives you. "klkropf" wrote: I only want the condtional formatting to apply to the part of the text that equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. |
conditional formatting only applies to part of cell text
Sub Bold_String()
Dim rng As Range Dim Cell As Range Dim start_str As Integer Set rng = Selection For Each Cell In rng start_str = InStr(Cell.Value, "PCC") If start_str Then With Cell.Characters(start_str, 3).Font .Bold = True .ColorIndex = 10 End With End If Next End Sub Gord Dibben MS Excel MVP On Mon, 5 May 2008 16:08:01 -0700, klkropf wrote: Do you know what the VBA code would be? "akphidelt" wrote: That would require VBA coding. Theres no way to do that with the normal conditional formatting that excel gives you. "klkropf" wrote: I only want the condtional formatting to apply to the part of the text that equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. |
conditional formatting only applies to part of cell text
Wow, I just tested that out... that is pretty sweet.
"Gord Dibben" wrote: Sub Bold_String() Dim rng As Range Dim Cell As Range Dim start_str As Integer Set rng = Selection For Each Cell In rng start_str = InStr(Cell.Value, "PCC") If start_str Then With Cell.Characters(start_str, 3).Font .Bold = True .ColorIndex = 10 End With End If Next End Sub Gord Dibben MS Excel MVP On Mon, 5 May 2008 16:08:01 -0700, klkropf wrote: Do you know what the VBA code would be? "akphidelt" wrote: That would require VBA coding. Theres no way to do that with the normal conditional formatting that excel gives you. "klkropf" wrote: I only want the condtional formatting to apply to the part of the text that equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. |
conditional formatting only applies to part of cell text
Thanks, I can get it to work if PCC is actually typed in the cell, but I'm
using a Vlookup to return the value. Will it work when doing that? "Gord Dibben" wrote: Sub Bold_String() Dim rng As Range Dim Cell As Range Dim start_str As Integer Set rng = Selection For Each Cell In rng start_str = InStr(Cell.Value, "PCC") If start_str Then With Cell.Characters(start_str, 3).Font .Bold = True .ColorIndex = 10 End With End If Next End Sub Gord Dibben MS Excel MVP On Mon, 5 May 2008 16:08:01 -0700, klkropf wrote: Do you know what the VBA code would be? "akphidelt" wrote: That would require VBA coding. Theres no way to do that with the normal conditional formatting that excel gives you. "klkropf" wrote: I only want the condtional formatting to apply to the part of the text that equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. |
conditional formatting only applies to part of cell text
Not unless you were to change the cell to a value.
You cannot format parts of formula results. Gord On Mon, 5 May 2008 17:18:01 -0700, klkropf wrote: Thanks, I can get it to work if PCC is actually typed in the cell, but I'm using a Vlookup to return the value. Will it work when doing that? "Gord Dibben" wrote: Sub Bold_String() Dim rng As Range Dim Cell As Range Dim start_str As Integer Set rng = Selection For Each Cell In rng start_str = InStr(Cell.Value, "PCC") If start_str Then With Cell.Characters(start_str, 3).Font .Bold = True .ColorIndex = 10 End With End If Next End Sub Gord Dibben MS Excel MVP On Mon, 5 May 2008 16:08:01 -0700, klkropf wrote: Do you know what the VBA code would be? "akphidelt" wrote: That would require VBA coding. Theres no way to do that with the normal conditional formatting that excel gives you. "klkropf" wrote: I only want the condtional formatting to apply to the part of the text that equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. |
Partial Formatting
Gord:
Your previous post was very helpful! Is it possible to format part of a cell if the cell contains both values and formulas? I'd like to format only the letter J in the following: = ("J ") &TEXT(B18+TIME(0,6,0),"h:mm") Thanks, Jonathan Gord Dibben wrote: Not unless you were to change the cell to a value. 05-May-08 Not unless you were to change the cell to a value. You cannot format parts of formula results. Gord wrote: Previous Posts In This Thread: On Monday, May 05, 2008 6:46 PM klkrop wrote: conditional formatting only applies to part of cell text I only want the condtional formatting to apply to the part of the text that equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. On Monday, May 05, 2008 6:51 PM akphidel wrote: That would require VBA coding. That would require VBA coding. Theres no way to do that with the normal conditional formatting that excel gives you. "klkropf" wrote: On Monday, May 05, 2008 7:08 PM klkrop wrote: conditional formatting only applies to part of cell text Do you know what the VBA code would be? "akphidelt" wrote: On Monday, May 05, 2008 7:28 PM akphidel wrote: to be honest I've never done this before so I really do not know. to be honest I've never done this before so I really do not know. I imagine you would have to loop through the range of cells everytime, search the cell for the given word you want using StrComp or something, then some how select the word within the sentence using some kind of find and range formulas and then change the color to whatever you want. It's possible but I'm not the man for the answer "klkropf" wrote: On Monday, May 05, 2008 7:37 PM Gord Dibben wrote: Sub Bold_String()Dim rng As RangeDim Cell As RangeDim start_str As Integer Sub Bold_String() Dim rng As Range Dim Cell As Range Dim start_str As Integer Set rng = Selection For Each Cell In rng start_str = InStr(Cell.Value, "PCC") If start_str Then With Cell.Characters(start_str, 3).Font .Bold = True .ColorIndex = 10 End With End If Next End Sub Gord Dibben MS Excel MVP On Mon, 5 May 2008 16:08:01 -0700, klkropf wrote: On Monday, May 05, 2008 7:52 PM akphidel wrote: conditional formatting only applies to part of cell text Wow, I just tested that out... that is pretty sweet. "Gord Dibben" wrote: On Monday, May 05, 2008 8:18 PM klkrop wrote: Thanks, I can get it to work if PCC is actually typed in the cell, but I'm Thanks, I can get it to work if PCC is actually typed in the cell, but I am using a Vlookup to return the value. Will it work when doing that? "Gord Dibben" wrote: On Monday, May 05, 2008 8:37 PM Gord Dibben wrote: Not unless you were to change the cell to a value. Not unless you were to change the cell to a value. You cannot format parts of formula results. Gord wrote: Submitted via EggHeadCafe - Software Developer Portal of Choice ASP.NET MVC RC2 http://www.eggheadcafe.com/tutorials...t-mvc-rc2.aspx |
Partial Formatting
Jonathan,
You cannot do that with a formula - but you can use event code to apply the format to a value. HTH, Bernie MS Excel MVP <GD104 wrote in message ... Gord: Your previous post was very helpful! Is it possible to format part of a cell if the cell contains both values and formulas? I'd like to format only the letter J in the following: = ("J ") &TEXT(B18+TIME(0,6,0),"h:mm") Thanks, Jonathan Gord Dibben wrote: Not unless you were to change the cell to a value. 05-May-08 Not unless you were to change the cell to a value. You cannot format parts of formula results. Gord wrote: Previous Posts In This Thread: On Monday, May 05, 2008 6:46 PM klkrop wrote: conditional formatting only applies to part of cell text I only want the condtional formatting to apply to the part of the text that equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. On Monday, May 05, 2008 6:51 PM akphidel wrote: That would require VBA coding. That would require VBA coding. Theres no way to do that with the normal conditional formatting that excel gives you. "klkropf" wrote: On Monday, May 05, 2008 7:08 PM klkrop wrote: conditional formatting only applies to part of cell text Do you know what the VBA code would be? "akphidelt" wrote: On Monday, May 05, 2008 7:28 PM akphidel wrote: to be honest I've never done this before so I really do not know. to be honest I've never done this before so I really do not know. I imagine you would have to loop through the range of cells everytime, search the cell for the given word you want using StrComp or something, then some how select the word within the sentence using some kind of find and range formulas and then change the color to whatever you want. It's possible but I'm not the man for the answer "klkropf" wrote: On Monday, May 05, 2008 7:37 PM Gord Dibben wrote: Sub Bold_String()Dim rng As RangeDim Cell As RangeDim start_str As Integer Sub Bold_String() Dim rng As Range Dim Cell As Range Dim start_str As Integer Set rng = Selection For Each Cell In rng start_str = InStr(Cell.Value, "PCC") If start_str Then With Cell.Characters(start_str, 3).Font .Bold = True .ColorIndex = 10 End With End If Next End Sub Gord Dibben MS Excel MVP On Mon, 5 May 2008 16:08:01 -0700, klkropf wrote: On Monday, May 05, 2008 7:52 PM akphidel wrote: conditional formatting only applies to part of cell text Wow, I just tested that out... that is pretty sweet. "Gord Dibben" wrote: On Monday, May 05, 2008 8:18 PM klkrop wrote: Thanks, I can get it to work if PCC is actually typed in the cell, but I'm Thanks, I can get it to work if PCC is actually typed in the cell, but I am using a Vlookup to return the value. Will it work when doing that? "Gord Dibben" wrote: On Monday, May 05, 2008 8:37 PM Gord Dibben wrote: Not unless you were to change the cell to a value. Not unless you were to change the cell to a value. You cannot format parts of formula results. Gord wrote: Submitted via EggHeadCafe - Software Developer Portal of Choice ASP.NET MVC RC2 http://www.eggheadcafe.com/tutorials...t-mvc-rc2.aspx |
Partial Formatting
Not until you copy and paste special as a value.
Or use VBA What value is in B18? Gord On Mon, 30 Nov 2009 08:38:15 -0800, GD104 wrote: Gord: Your previous post was very helpful! Is it possible to format part of a cell if the cell contains both values and formulas? I'd like to format only the letter J in the following: = ("J ") &TEXT(B18+TIME(0,6,0),"h:mm") Thanks, Jonathan Gord Dibben wrote: Not unless you were to change the cell to a value. 05-May-08 Not unless you were to change the cell to a value. You cannot format parts of formula results. Gord wrote: Previous Posts In This Thread: On Monday, May 05, 2008 6:46 PM klkrop wrote: conditional formatting only applies to part of cell text I only want the condtional formatting to apply to the part of the text that equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC" and I only want PCC to be bold and green and Jane Smith to remain the same. On Monday, May 05, 2008 6:51 PM akphidel wrote: That would require VBA coding. That would require VBA coding. Theres no way to do that with the normal conditional formatting that excel gives you. "klkropf" wrote: On Monday, May 05, 2008 7:08 PM klkrop wrote: conditional formatting only applies to part of cell text Do you know what the VBA code would be? "akphidelt" wrote: On Monday, May 05, 2008 7:28 PM akphidel wrote: to be honest I've never done this before so I really do not know. to be honest I've never done this before so I really do not know. I imagine you would have to loop through the range of cells everytime, search the cell for the given word you want using StrComp or something, then some how select the word within the sentence using some kind of find and range formulas and then change the color to whatever you want. It's possible but I'm not the man for the answer "klkropf" wrote: On Monday, May 05, 2008 7:37 PM Gord Dibben wrote: Sub Bold_String()Dim rng As RangeDim Cell As RangeDim start_str As Integer Sub Bold_String() Dim rng As Range Dim Cell As Range Dim start_str As Integer Set rng = Selection For Each Cell In rng start_str = InStr(Cell.Value, "PCC") If start_str Then With Cell.Characters(start_str, 3).Font .Bold = True .ColorIndex = 10 End With End If Next End Sub Gord Dibben MS Excel MVP On Mon, 5 May 2008 16:08:01 -0700, klkropf wrote: On Monday, May 05, 2008 7:52 PM akphidel wrote: conditional formatting only applies to part of cell text Wow, I just tested that out... that is pretty sweet. "Gord Dibben" wrote: On Monday, May 05, 2008 8:18 PM klkrop wrote: Thanks, I can get it to work if PCC is actually typed in the cell, but I'm Thanks, I can get it to work if PCC is actually typed in the cell, but I am using a Vlookup to return the value. Will it work when doing that? "Gord Dibben" wrote: On Monday, May 05, 2008 8:37 PM Gord Dibben wrote: Not unless you were to change the cell to a value. Not unless you were to change the cell to a value. You cannot format parts of formula results. Gord wrote: Submitted via EggHeadCafe - Software Developer Portal of Choice ASP.NET MVC RC2 http://www.eggheadcafe.com/tutorials...t-mvc-rc2.aspx |
Partial Formatting
You would need to do this with VBA. What cell or cells have the formula you
are showing? What formatting do you want to do to the letter "J"? Can this letter be more than one character? -- Rick (MVP - Excel) "GD104" wrote in message ... Gord: Your previous post was very helpful! Is it possible to format part of a cell if the cell contains both values and formulas? I'd like to format only the letter J in the following: = ("J ") &TEXT(B18+TIME(0,6,0),"h:mm") Thanks, Jonathan |
conditional formatting only applies to part of cell text
@Gord Dibben Thanks a lot for your Code.....it helped a lot :)
|
All times are GMT +1. The time now is 03:33 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com