ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Bold date (https://www.excelbanter.com/excel-worksheet-functions/7561-bold-date.html)

Ted Metro

Bold date
 
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



Frank Kabel

Hi
not possible

--
Regards
Frank Kabel
Frankfurt, Germany

"Ted Metro" <Ted schrieb im
Newsbeitrag ...
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




Ron Rosenfeld

On Tue, 7 Dec 2004 07:27:01 -0800, Ted Metro <Ted
wrote:

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



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


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com