posted in the Programming / VBA / Macros
True - I got here (initially) from the 'What's New?' page. Never looked where i ended up.
Option Explicit
Option Compare Text
Function SpecialCase(str As String, Optional ToUpperNums As Boolean = False) As String
Dim Wrds As Variant
Dim lngLoop As Long
Wrds = Split(str, " ")
For lngLoop = LBound(Wrds) To UBound(Wrds)
If Not Wrds(lngLoop) Like "*[0-9]*" Then
Wrds(lngLoop) = StrConv(Wrds(lngLoop), vbProperCase)
Else
If ToUpperNums Then
Wrds(lngLoop) = StrConv(Wrds(lngLoop), vbUpperCase)
End If
End If
Next
SpecialCase = Join(Wrds, " ")
End Function
Takes an optional 2nd parameter to upper case 'words' that contain a numeral - Part numbers, for example.
Bookmarks