ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Auto Proper Case on Entry (https://www.excelbanter.com/excel-worksheet-functions/39091-auto-proper-case-entry.html)

John

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




Paul B

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






John

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








Paul B

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










David McRitchie

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











All times are GMT +1. The time now is 01:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com