Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 454
Default Changing Entries to Proper and Upper Case Q

I am trying to Capitalise all values (ucase) in a certain range of
cells, see A values below and changing other values, see C and M
below, to proper case.

These woulkd be changed on entry in to the various cells, but its not
working. The original typed values are uneffected, can anyone suggest
why?



Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells,
Range("C18,M18,C23,M23,C28,M28,C33,M33,C38,M38,C43 ,M43,C48,M48,C53,M53,C58,M58,C63,M63"))
Is Nothing Then
Application.EnableEvents = False
.Value = Application.Proper(.Value)
Application.EnableEvents = True
End If
End If
End With

With Target
If .Count = 1 Then
If Not Intersect(.Cells,
Range("A18,A23,A28,A33,A38,A43,A48,A53,A58,A63")) Is Nothing Then
Application.EnableEvents = False
.Value = Application.UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default Changing Entries to Proper and Upper Case Q

It is capitalizing only the first letter of the word try replacing
from:
..Value = Application.UCase(.Value)
to:
.Value = StrConv(.Value, vbUpperCase)

"Sean" wrote:

I am trying to Capitalise all values (ucase) in a certain range of
cells, see A values below and changing other values, see C and M
below, to proper case.

These woulkd be changed on entry in to the various cells, but its not
working. The original typed values are uneffected, can anyone suggest
why?



Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells,
Range("C18,M18,C23,M23,C28,M28,C33,M33,C38,M38,C43 ,M43,C48,M48,C53,M53,C58,M58,C63,M63"))
Is Nothing Then
Application.EnableEvents = False
.Value = Application.Proper(.Value)
Application.EnableEvents = True
End If
End If
End With

With Target
If .Count = 1 Then
If Not Intersect(.Cells,
Range("A18,A23,A28,A33,A38,A43,A48,A53,A58,A63")) Is Nothing Then
Application.EnableEvents = False
.Value = Application.UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Changing Entries to Proper and Upper Case Q

Your code appears to work. Just run:

Sub demo()
Application.EnableEvents = True
End Sub

first
--
Gary''s Student - gsnu200713
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 454
Default Changing Entries to Proper and Upper Case Q

On Apr 1, 2:01 pm, "Don Guillett" wrote:
You may be locked so use this



and then try this without application
.Value = UCase(.Value)

--
Don Guillett
SalesAid Software
"Sean" wrote in message

oups.com...



I am trying to Capitalise all values (ucase) in a certain range of
cells, see A values below and changing other values, see C and M
below, to proper case.


These woulkd be changed on entry in to the various cells, but its not
working. The original typed values are uneffected, can anyone suggest
why?


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells,
Range("C18,M18,C23,M23,C28,M28,C33,M33,C38,M38,C43 ,M43,C48,M48,C53,M53,C58,*M58,C63,M63"))
Is Nothing Then
Application.EnableEvents = False
.Value = Application.Proper(.Value)
Application.EnableEvents = True
End If
End If
End With


With Target
If .Count = 1 Then
If Not Intersect(.Cells,
Range("A18,A23,A28,A33,A38,A43,A48,A53,A58,A63")) Is Nothing Then
Application.EnableEvents = False
.Value = Application.UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub- Hide quoted text -


- Show quoted text -


Thanks Don, that worked, but what was the -
Sub fixit()
Application.EnableEvents = True
End Sub

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
Changing file in all upper case to upper and lower case Sagit Excel Discussion (Misc queries) 15 May 30th 07 06:08 AM
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
changing lower case to upper case T. Campbell Excel Discussion (Misc queries) 1 December 8th 04 05:37 PM


All times are GMT +1. The time now is 05:12 PM.

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"