PC Review


Reply
Thread Tools Rate Thread

adding bold to formula cell

 
 
mwam423
Guest
Posts: n/a
 
      24th Jun 2008
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 With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      24th Jun 2008
Select A4, Ctrl-B

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"mwam423" <(E-Mail Removed)> wrote in message
news:1837C495-B302-4B22-A77D-(E-Mail Removed)...
> 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 With Quote
 
RyanH
Guest
Posts: n/a
 
      24th Jun 2008
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?

 
Reply With Quote
 
mwam423
Guest
Posts: n/a
 
      24th Jun 2008
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


 
Reply With Quote
 
mwam423
Guest
Posts: n/a
 
      24th Jun 2008
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


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      24th Jun 2008
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
 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      24th Jun 2008
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
 
Reply With Quote
 
mwam423
Guest
Posts: n/a
 
      24th Jun 2008
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.


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      24th Jun 2008
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 <(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?


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      24th Jun 2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
bold text of referenced cell show in formula cell zabcikranch Microsoft Excel Worksheet Functions 1 2nd Feb 2010 07:42 PM
Show results in bold if a cell is in bold Diana Microsoft Excel Discussion 2 20th Dec 2009 05:18 PM
adding cell comment via VBA (bold font?) =?Utf-8?B?R3JlZw==?= Microsoft Excel Programming 3 20th Jul 2007 10:54 PM
Join bold and non-bold text in one cell bkincaid Microsoft Excel Misc 3 21st Mar 2006 12:58 AM
adding a formula in a cell but when cell = 0 cell is blank =?Utf-8?B?TWlrZSBU?= Microsoft Excel Worksheet Functions 5 31st May 2005 01:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:25 AM.