a macro to PROPER text

  • Thread starter Thread starter pcor
  • Start date Start date
Hi

Sub SetProper()

Dim c As Range
For Each c In Selection
c.Value = WorksheetFunction.Proper(c.Value)
Next

End Sub
 
Thanks. That worked very well. I had thought that to use this macro I could
replace "Proper" with "Upper" or "Lower" but that did not work. So How do I
change your macro to change the cell to either UPPER or LOWER format.
Thanks
Ian M
 
Hi,

For Proper you need to call the worksheet function but for upper and lower
you must use UCase and PCase

c.Value = UCase(c.Value)
 
Many thanks.Worked very well


Shane Devenshire said:
Hi,

For Proper you need to call the worksheet function but for upper and lower
you must use UCase and PCase

c.Value = UCase(c.Value)

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire
 
Back
Top