First Cap. and Bold ?

danial

Board Regular
Joined
Apr 29, 2006
Messages
107
Sawasdee,

I want to create code for change any sentense to Title style.
:oops: business contigency plan > Business Contigency Plan
may be I use function PROPER to convert it.
but I need to change first of ... to Bold character
Business Contigency Plan

Please share any idea for create code command many sentense.

thank in advance,
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
This worked for me :

Code:
Sub Bold_And_Proper(r As Range)

Dim oChr As Object, i As Byte
Dim sText As String

    sText = " " & r
    On Error Resume Next
    For i = 1 To Len(sText)
        If (Mid(sText, i - 1, 1) = " " And Mid(sText, i, 1) <> " ") Then
            With r.Characters(i - 1, 1)
                .Font.Bold = True
                .Text = UCase(.Text)
            End With
        End If
    Next

End Sub


Sub TEST()

    Bold_And_Proper Range("a1")

End Sub

Where A1 is the Cell with the Text to formatted.

Regards.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,262
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top