Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Proper Case with .

Hi

I have managed to put this code together thanks
to "Pearson Software " websight but does anyone have
an idea on how I can add a (.) *thats period, after the first upper
case.

J. Smith




Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("E4:E300, F4:F300")) Is
Nothing Then
Target(1).Value = StrConv(Target(1).Value, vbProperCase)
End If
Application.EnableEvents = True
End Sub


thanks in advance
Graham

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Proper Case with .

Graham,

Do you mean that 'job smith' becomes 'J.Smith'. If so, then try

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("E4:E300, F4:F300")) Is Nothing Then
With Target(1)
.Value = UCase(Left(.Value, 1)) & "." & _
StrConv(Right(.Value, Len(.Value) - 1),
vbProperCase)
End With
End If
Application.EnableEvents = True
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"graham gordon" wrote in message
...
Hi

I have managed to put this code together thanks
to "Pearson Software " websight but does anyone have
an idea on how I can add a (.) *thats period, after the first upper
case.

J. Smith




Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("E4:E300, F4:F300")) Is
Nothing Then
Target(1).Value = StrConv(Target(1).Value, vbProperCase)
End If
Application.EnableEvents = True
End Sub


thanks in advance
Graham

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Proper Case with .

Just for consideration:

given
sStr = "ABCDEFGHIJK"

Bob's formula:

? UCase(Left(sStr, 1)) & "." & StrConv(Right(sStr, Len(sStr) -
1),vbProperCase)

Gives:
A.Bcdefghijk


My guess was you actually want:
? UCase(Left(sStr, 1)) & "." & Right(strConv(sStr,vbProperCase), Len(sStr) -
1)

which Gives:
A.bcdefghijk

--
Regards,
Tom Ogilvy



Bob Phillips wrote in message
...
Graham,

Do you mean that 'job smith' becomes 'J.Smith'. If so, then try

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("E4:E300, F4:F300")) Is Nothing Then
With Target(1)
.Value = UCase(Left(.Value, 1)) & "." & _
StrConv(Right(.Value, Len(.Value) - 1),
vbProperCase)
End With
End If
Application.EnableEvents = True
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"graham gordon" wrote in message
...
Hi

I have managed to put this code together thanks
to "Pearson Software " websight but does anyone have
an idea on how I can add a (.) *thats period, after the first upper
case.

J. Smith




Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("E4:E300, F4:F300")) Is
Nothing Then
Target(1).Value = StrConv(Target(1).Value, vbProperCase)
End If
Application.EnableEvents = True
End Sub


thanks in advance
Graham

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





Reply
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
How do I change from upper case to proper case in excel 2002 CT Man[_2_] Excel Discussion (Misc queries) 8 January 8th 08 06:14 PM
Proper Case Roger Bell Excel Discussion (Misc queries) 14 June 2nd 07 11:04 PM
excel'03 how to convert a column from upper case to proper case sharie palmer Excel Discussion (Misc queries) 1 January 30th 06 11:50 PM
Excel: How do I change all upper case ss to proper case? Moosieb Excel Worksheet Functions 3 January 13th 06 12:45 AM
Changing Upper case to Proper Case Mountain Excel Worksheet Functions 1 January 13th 05 10:37 PM


All times are GMT +1. The time now is 08:28 AM.

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

About Us

"It's about Microsoft Excel"