Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default adding bold to formula cell


thanks ron, like this as it looks like it can accommodate changes in
verbage, much appreciated!
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default adding bold to formula cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default adding bold to formula cell

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
bold text of referenced cell show in formula cell zabcikranch Excel Worksheet Functions 1 February 2nd 10 07:42 PM
Alphabetically list of last names: BOLD, not bold Lerner Excel Discussion (Misc queries) 16 March 1st 09 07:46 PM
conditional formating bold is true not bold false how victorio0704 Excel Programming 4 June 25th 08 04:29 PM
adding cell comment via VBA (bold font?) Greg Excel Programming 3 July 20th 07 10:54 PM
Join bold and non-bold text in one cell bkincaid Excel Discussion (Misc queries) 3 March 21st 06 12:58 AM


All times are GMT +1. The time now is 09:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"