Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Select A4, Ctrl-B
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "mwam423" wrote in message ... 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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi bob, i would like just the information from those cells in bold, the other
words in A4 i'd like without boldface "Bob Phillips" wrote: Select A4, Ctrl-B |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("A1:A2").Font.Bold = True
Ryan "mwam423" 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? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi ryan, appreciate the quick reply, however, i haven't done good job of
describing what i need. in A4 which returns a sentence i'd like only the date from A1 and single word in A2 in boldface, other words would not be in bold. "RyanH" wrote: Range("A1:A2").Font.Bold = True |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oops! You are right, I did misunderstand. You can try this.
Dim myRangeA1 As String Dim myRangeA2 As String myRangeA1 = Range("A1") myRangeA2 = Range("A2") With Range("A4") .Value = "On " & myRangeA1 & ", please " & myRangeA2 & " funds for a margin call." .Characters(4, Len(myRangeA1)).Font.Bold = True .Characters(13 + Len(myRangeA1), Len(myRangeA2)).Font.Bold = True End With End Sub Ryan "mwam423" wrote: hi ryan, appreciate the quick reply, however, i haven't done good job of describing what i need. in A4 which returns a sentence i'd like only the date from A1 and single word in A2 in boldface, other words would not be in bold. "RyanH" wrote: Range("A1:A2").Font.Bold = True |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Formulas don't support this kind of formatting.
mwam423 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? -- Dave Peterson |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi dave, hope you're well. any code you can provide would be greatly
appreciated. "Dave Peterson" wrote: Formulas don't support this kind of formatting. |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could convert the formula to a value and do the formatting.
But you can't do this kind of formatting (manually or in code) and keep the formula. mwam423 wrote: hi dave, hope you're well. any code you can provide would be greatly appreciated. "Dave Peterson" wrote: Formulas don't support this kind of formatting. -- Dave Peterson |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi dave, yes i would lose the formula. the code provided by ryan and ron get
the result i need, thanks! "Dave Peterson" wrote: You could convert the formula to a value and do the formatting. But you can't do this kind of formatting (manually or in code) and keep the formula. |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 24 Jun 2008 10:21:05 -0700, mwam423
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 |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() thanks ron, like this as it looks like it can accommodate changes in verbage, much appreciated! |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 24 Jun 2008 16:05:01 -0700, mwam423
wrote: thanks ron, like this as it looks like it can accommodate changes in verbage, much appreciated! Glad to help. Thanks for the feedback. --ron |
#14
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You cannot Bold just the Date from A1 and text from A2 using a formula.
Private Sub boldem() With ActiveSheet.Range("A4") .Value = "On " & Range("A1").Value & " please " & Range("A2").Value _ & " funds for a margin call." With .Characters(Start:=4, Length:=Len(Range("A1").Value)).Font .FontStyle = "Bold" End With With .Characters(Start:=Len(Range("A1").Value) + 12, _ Length:=Len(Range("A2").Value)).Font .FontStyle = "Bold" End With End With End Sub Assumes shortdate format of dd/MMM/yy or similar length Gord Dibben MS Excel MVP On Tue, 24 Jun 2008 10:21:05 -0700, mwam423 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
bold text of referenced cell show in formula cell | Excel Worksheet Functions | |||
Alphabetically list of last names: BOLD, not bold | Excel Discussion (Misc queries) | |||
conditional formating bold is true not bold false how | Excel Programming | |||
adding cell comment via VBA (bold font?) | Excel Programming | |||
Join bold and non-bold text in one cell | Excel Discussion (Misc queries) |