Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
John
 
Posts: n/a
Default Auto Proper Case on Entry

I wish to change the values entered within an area to PROPER case on entry.
I have the following code which I use to automatically change all entered
values to UPPER

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("C16:F16")) Is Nothing Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub

I thought it was a 'simple' case of just changing the text UCase to
something like ProperCase or PCase, but it doesn't work.

Can someone help?

Thanks



  #2   Report Post  
Paul B
 
Posts: n/a
Default

John, try,
..Value = Application.Proper(Target.Value)

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"John" wrote in message
...
I wish to change the values entered within an area to PROPER case on

entry.
I have the following code which I use to automatically change all entered
values to UPPER

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("C16:F16")) Is Nothing Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub

I thought it was a 'simple' case of just changing the text UCase to
something like ProperCase or PCase, but it doesn't work.

Can someone help?

Thanks





  #3   Report Post  
John
 
Posts: n/a
Default

Thanks Paul works a treat


"Paul B" wrote in message
...
John, try,
.Value = Application.Proper(Target.Value)

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"John" wrote in message
...
I wish to change the values entered within an area to PROPER case on

entry.
I have the following code which I use to automatically change all entered
values to UPPER

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("C16:F16")) Is Nothing Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub

I thought it was a 'simple' case of just changing the text UCase to
something like ProperCase or PCase, but it doesn't work.

Can someone help?

Thanks







  #4   Report Post  
Paul B
 
Posts: n/a
Default

Your Welcome

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"John" wrote in message
...
Thanks Paul works a treat


"Paul B" wrote in message
...
John, try,
.Value = Application.Proper(Target.Value)

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"John" wrote in message
...
I wish to change the values entered within an area to PROPER case on

entry.
I have the following code which I use to automatically change all

entered
values to UPPER

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("C16:F16")) Is Nothing Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub

I thought it was a 'simple' case of just changing the text UCase to
something like ProperCase or PCase, but it doesn't work.

Can someone help?

Thanks









  #5   Report Post  
David McRitchie
 
Posts: n/a
Default

You can also make your macro more generic by using Selection
instead of a specific cell range.
http://www.mvps.org/dmcritchie/excel/proper.htm#upper
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"John" wrote in message ...
Thanks Paul works a treat


"Paul B" wrote in message
...
John, try,
.Value = Application.Proper(Target.Value)

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"John" wrote in message
...
I wish to change the values entered within an area to PROPER case on

entry.
I have the following code which I use to automatically change all entered
values to UPPER

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("C16:F16")) Is Nothing Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub

I thought it was a 'simple' case of just changing the text UCase to
something like ProperCase or PCase, but it doesn't work.

Can someone help?

Thanks









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
I NEED HELP with the SPELLNUMBER Function vag Excel Worksheet Functions 0 June 21st 05 08:17 AM
EXCEL:NUMBER TO GREEK WORDS vag Excel Worksheet Functions 1 June 15th 05 05:57 PM
convert value in word. For Exampe Rs.115.00 convert into word as . Shakti Excel Discussion (Misc queries) 1 May 10th 05 12:00 PM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
Is there a formula to spell out a number in excel? Sha-nay-nay Excel Worksheet Functions 2 December 18th 04 09:25 PM


All times are GMT +1. The time now is 06:33 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"