On Tue, 24 Jun 2008 10:21:05 -0700, mwam423 <(E-Mail Removed)>
wrote:
>greetings, have cell, say A4, which forms a statement by pulling values from
>two different cells, e.g., ="On "&A1&", please "&A2&" funds for a margin
>call."
>
>A1 contains a datevalue; A2 contains text, either "deliver", or "receive".
>how can i have the information in A1 and A2 show as boldface in my statement
>cell?
You cannot do that directly. In Excel, you can only differentially bold text
strings -- not the results of formulas.
The Sub below demonstrates how to do this. It could be shortened, but I wanted
to show all the steps:
================================
Option Explicit
Sub BoldA1A2()
Dim s As String, sA1 As String, sA2 As String
Const s1 As String = "On "
Const s2 As String = ", please "
Const s3 As String = " funds for a margin call."
sA1 = Range("A1").Text
sA2 = Range("A2").Text
With Range("A4")
.Value = s1 & sA1 & s2 & sA2 & s3
.Characters(1 + Len(s1), Len(sA1)).Font.Bold = True
.Characters(1 + Len(s1) + Len(sA1) + Len(s2), Len(sA2)).Font.Bold = True
End With
End Sub
================================
--ron
|