LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Proper() function handling of apostrophe

Click on all the problematic cells, and run this sub:
Sub ChangeCase()
Application.ScreenUpdating = False
Dim r As Range
nCase = UCase(InputBox("Enter U for UPPER" & Chr$(13) & " L for
lower" & Chr$(13) & " Or " & Chr$(13) & " P for Proper", "Select
Case Desired"))
Select Case nCase
Case "L"
For Each r In Selection.Cells
If r.HasFormula Then
r.Formula = LCase(r.Formula)
'R.Formula = R.Value
Else
r.Value = LCase(r.Value)
End If
Next

Case "U"
For Each r In Selection.Cells
If r.HasFormula Then
r.Formula = UCase(r.Formula)
'R.Formula = R.Value
Else
r.Value = UCase(r.Value)
End If
Next
Case "P"

For Each r In Selection.Cells
If r.HasFormula Then
r.Formula = Application.Proper(r.Formula)
'R.Formula = R.Value
Else
r.Value = StrConv(r.Value, vbProperCase)
End If
Next
End Select
Application.ScreenUpdating = True
End Sub

PS, I didn't come up with this idea; found it on the Excel-Programming DG a
while back...

Regards,
Ryan---

--
RyGuy


"Valpey" wrote:

The Proper() function incorrectly handles possessive apostrophes. (e.g.
Proper(STEVE'S BAR AND GRILL) returns "Steve'S Bar And Grill". Is there a
simple way to return "Steve's Bar And Grill"; or even better "Steve's Bar and
Grill"?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sumproduct bllank function handling Walter Briscoe Excel Worksheet Functions 0 September 4th 07 05:42 PM
PROPER FUNCTION ACE PRODUCTS Excel Worksheet Functions 5 July 12th 07 01:38 AM
checkbox event handling function nevwalters Excel Worksheet Functions 2 May 16th 06 04:27 AM
PROPER function Danielle via OfficeKB.com Excel Worksheet Functions 2 October 14th 05 09:50 PM
How do I use the PROPER function? Lynn in Tulsa Excel Worksheet Functions 6 August 15th 05 07:36 PM


All times are GMT +1. The time now is 10:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"