A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

formula to BOLD partial number



 
 
Thread Tools Display Modes
  #1  
Old August 11th, 2009, 04:21 PM posted to microsoft.public.excel.newusers
Israel
external usenet poster
 
Posts: 64
Default formula to BOLD partial number

Helo,

MY experience with your group is awesome. Can you help me with this one,

I have time data "06:09:23" is there a formula where I can indicate the
first two caracters ("06") to be bold. Manually to do this could be quite a
hassle for a couple of hundred cells.

Thank you

smile
  #2  
Old August 11th, 2009, 04:42 PM posted to microsoft.public.excel.newusers
Don Guillett
external usenet poster
 
Posts: 6,167
Default formula to BOLD partial number

One simple way

Sub boldleft2()
For Each c In Selection
c.Characters(1, 2).Font.Bold = True
Next
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"israel" wrote in message
...
Helo,

MY experience with your group is awesome. Can you help me with this one,

I have time data "06:09:23" is there a formula where I can indicate the
first two caracters ("06") to be bold. Manually to do this could be quite
a
hassle for a couple of hundred cells.

Thank you

smile


  #3  
Old August 11th, 2009, 05:18 PM posted to microsoft.public.excel.newusers
Ron Rosenfeld
external usenet poster
 
Posts: 3,719
Default formula to BOLD partial number

On Tue, 11 Aug 2009 08:21:01 -0700, israel
wrote:

Helo,

MY experience with your group is awesome. Can you help me with this one,

I have time data "06:09:23" is there a formula where I can indicate the
first two caracters ("06") to be bold. Manually to do this could be quite a
hassle for a couple of hundred cells.

Thank you

smile


If those values are Excel time values, then you would have to first convert
them to text strings. If you do that, any formula which has these values as a
precedent would have to be changed, to take that into account.

To do this, you'd need a VBA Sub procedure.

To enter this Macro (Sub), alt-F11 opens the Visual Basic Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.

To use this Macro (Sub), first select the cells you wish to change. Then
alt-F8 opens the macro dialog box. Select the macro by name, and RUN.


======================
Option Explicit
Sub boldleft2()
Dim c As Range
For Each c In Selection
With c
.NumberFormat = "@"
.Value = Format(.Value, "hh:mm:ss")
.Font.Bold = False
.Characters(1, 2).Font.Bold = True
End With
Next c
End Sub
=========================
--ron
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.