Proper

  • Thread starter Thread starter !!!
  • Start date Start date
There is none so you can use

Application.Proper(Range("A1"))

as an example

Regards,

Peo Sjoblom
 
Hi ....,
and if you would like to refine and improve usage in your macro
for lastnames such as my own, and for a correct title case as
in "A Year to Remember" take a look at
http://www.mvps.org/dmcritchie/excel/proper.htm
You would still have to make some adjustments but that should
get you a better start.
 
VBA has its own builtin function, too:

Option Explicit
Sub testme()
Dim myStr As String
myStr = "now is the TIME FOr all good MEN TO COME..."
myStr = StrConv(myStr, vbProperCase)
MsgBox myStr
End Sub
 
Try this,

Range("A1").Value=Application.WorksheetFunction.Proper(Range("A1").Value)

Mike
 
Specifically (to match Mike's example)...

Range("A1").Value = StrConv(Range("A1").Value, vbProperCase)

where the predefined vbProperCase constant tells it to perform the proper
case conversion.

Rick
 
StrConv is quite a bit faster. 8 times faster, according to my
calculations.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top