Forum Discussion
SM_Talal
Jul 04, 2019Copper Contributor
Conversion in PROPER Case except the word(s) written in CAPITAL Letter.
Hi, I want to change a sentence written in a single cell to PROPER Case except the word(s) written in CAPITAL Letter. For E:g 1, From, "I love APPLE" To, "I Love APPLE" For E:g 2, From, "...
- Jul 04, 2019
SM_Talal This User defined function (in a normal module in VBA) seems to do it:
Option Explicit Function MyProper(Source As Variant) As String Dim Data As Variant Dim lWd As Long Dim Words As Variant If TypeName(Source) = "Range" Then Data = Source.Value Else Data = Source End If Words = Split(Data, " ") For lWd = LBound(Words, 1) To UBound(Words, 1) If Words(lWd) <> UCase(Words(lWd)) Then Words(lWd) = Application.Proper(Words(lWd)) End If Next MyProper = Trim(Join(Words, " ")) End Function
Haytham Amairah
Jul 04, 2019Silver Contributor
Hi,
I'll show you the easiest way I found to do so!
Please check out this video:
https://1drv.ms/v/s!ArtU2vr1IWYYhLsK1YfN0Kdj2f-CQg?e=Q40WSS
Hope that helps
- SM_TalalJul 05, 2019Copper ContributorThanks a lot Haytham Amairah ..