If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Bolding specific text in a formula
I am concatenating 3 cells, '=a2&b2&c2' and with the
result of this, i need the text that is in cell b2, to be bold, so that i can get an answer of 'This is great' where 'is' is in bold. Can anyone help? |
#2
|
|||
|
|||
Bolding specific text in a formula
"Scot Rundell`" wrote in message
... I am concatenating 3 cells, '=a2&b2&c2' and with the result of this, i need the text that is in cell b2, to be bold, so that i can get an answer of 'This is great' where 'is' is in bold. Can anyone help? You cannot do this. Formulas create cell content, not format. Even conditional formatting formulas can only determine whole cell formatting, not the formatting of part of the cell contents. |
#3
|
|||
|
|||
Bolding specific text in a formula
"Anon" none wrote in message ... "Scot Rundell`" wrote in message ... I am concatenating 3 cells, '=a2&b2&c2' and with the result of this, i need the text that is in cell b2, to be bold, so that i can get an answer of 'This is great' where 'is' is in bold. Can anyone help? You cannot do this. Formulas create cell content, not format. Even conditional formatting formulas can only determine whole cell formatting, not the formatting of part of the cell contents. Hmm - try typing ABC ctrl-B DEF enter Don't think this works for formulae, though |
#4
|
|||
|
|||
Bolding specific text in a formula
"Scot Rundell`" wrote in message ... I am concatenating 3 cells, '=a2&b2&c2' and with the result of this, i need the text that is in cell b2, to be bold, so that i can get an answer of 'This is great' where 'is' is in bold. Can anyone help? Could you avoid concatenating - just put three narrow columns close together, then apply conditional formatting to middle column |
#5
|
|||
|
|||
Bolding specific text in a formula
"Scot Rundell`" wrote...
I am concatenating 3 cells, '=a2&b2&c2' and with the result of this, i need the text that is in cell b2, to be bold, so that i can get an answer of 'This is great' where 'is' is in bold. Can anyone help? You can't do this directly. You *can* simulate this with VBA, supporting cells and picture links. Warning: this is KLUNKY! If you concatenate these cells in a cell in a one-column range named Mirror, adding HTML-like formatting tags, so your formula would look like =A1&"B"&B1&"/B"&C1 Then you could use an event handler like the following very simplified one to render these into formatted text constants in the cells to the right of Mirror. Note: this even handler would need to be in the VBA class module for the worksheet containing the Mirror range. Private Sub Worksheet_Calculate() Dim c As Range, f As String, p As Long, q As Long On Error GoTo CleanUp Application.EnableEvents = False For Each c In ThisWorkbook.Names("Mirror").RefersToRange f = c.Text p = InStr(1, f, "B", vbTextCompare) q = InStr(p, f, "/B", vbTextCompare) If p 0 And q p Then f = Left(f, p - 1) & Mid(f, p + 3, q - p - 3) & Mid(f, q + 4) c.Offset(0, 1).Formula = f c.Offset(0, 1).Characters(p, q - p - 3).Font.Bold = True End If Next c CleanUp: Application.EnableEvents = True End Sub Finally, select the cell immediately to the right of the one containing the concatenation formula in Mirror, Edit Copy, then select the cell where you want the formatted result to appear, hold down a [Shift] key, and issue the menu command Edit Paste Picture Link. You now have a picture link to the formatted text that will update whenever any of the three source cells changes. The event handler above could be made to handle much more complicated HTML-like formatting. This is a stripped down example that's only intended to allow you to assess whether or not this approach would work for you. I'll repeat the warning, though: this is KLUNKY! -- Never attach files. Snip unnecessary quoted text. Never multipost (though crossposting is usually OK). Don't change subject lines because it corrupts Google newsgroup archives. |
Thread Tools | |
Display Modes | |
|
|