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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
8,253
Office Version
  1. 2016
Platform
  1. Windows
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.
 

danial

Board Regular
Joined
Apr 29, 2006
Messages
107
Thank a lot
If I want to say thank you in morocco. what can I say?
 

Forum statistics

Threads
1,136,697
Messages
5,677,264
Members
419,682
Latest member
M3one

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
Top