Bold date

G

Guest

Here's my formula in a cell --

"Balance (As of "&TEXT(TODAY(),"mm/dd/yyyy")&")"

And it returns --

Balance (As of 12/07/2004)

I'd like the date to be bold but nothing else, but I can't figure out how to
do it. I've tried highlighting that portion of the formula and using the
cell format button, as well as the bold button, but they are both grayed out.

Any ideas to keep everything regular font and just have 12/07/2004 as bold??

Ted
(e-mail address removed)
 
R

Ron Rosenfeld

On Tue, 7 Dec 2004 07:27:01 -0800, Ted Metro <Ted
Here's my formula in a cell --

"Balance (As of "&TEXT(TODAY(),"mm/dd/yyyy")&")"

And it returns --

Balance (As of 12/07/2004)

I'd like the date to be bold but nothing else, but I can't figure out how to
do it. I've tried highlighting that portion of the formula and using the
cell format button, as well as the bold button, but they are both grayed out.

Any ideas to keep everything regular font and just have 12/07/2004 as bold??

Ted
(e-mail address removed)


Well, one way to do it is by using VBA. You run a VBA routine which puts the
string result of your formula into a cell (not the formula itself). You can
then BOLD a portion of the cell.

For example:

=========================
Sub BoldDate()
Dim str As String

str = "Balance (as of " & Format(Date, "mm/dd/yyyy") & ")"

Selection = str
Selection.Characters(16, 10).Font.Bold = True

End Sub
======================

To enter this, <alt-F11> opens the VB Editor.
Ensure your project is highlighted in the Project Explorer window. Then
Insert/Module and paste the above code into the window that opens.

Select any cell. Then <alt-F8> and run the BoldDate macro.


--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top