Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Upper Case on Input Q

I have the attached that I wish to Capitalise all entries within a
particular worksheet in Column D9:D44, my problem is that when I enter a
lower case value into anyone of the cells, it remains lowercase, what am I
doing wrong?

Thanks



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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Upper Case on Input Q

John,

Worksheet event code has specific names, you can't change them to whatever
you fancy. There is no ChangeToUpper event, just a Change event

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



--

HTH

RP
(remove nothere from the email address if mailing direct)


"John" wrote in message
...
I have the attached that I wish to Capitalise all entries within a
particular worksheet in Column D9:D44, my problem is that when I enter a
lower case value into anyone of the cells, it remains lowercase, what am I
doing wrong?

Thanks



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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Upper Case on Input Q

Aaaaaah, I had another Change event in the same worksheet Bob that changes a
different column to Proper so that why I renamed it when it wouldn't work
the first time. How would I combine the two?

Thanks again

"Bob Phillips" wrote in message
...
John,

Worksheet event code has specific names, you can't change them to whatever
you fancy. There is no ChangeToUpper event, just a Change event

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



--

HTH

RP
(remove nothere from the email address if mailing direct)


"John" wrote in message
...
I have the attached that I wish to Capitalise all entries within a
particular worksheet in Column D9:D44, my problem is that when I enter a
lower case value into anyone of the cells, it remains lowercase, what am

I
doing wrong?

Thanks



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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Upper Case on Input Q

Got it!

Thanks

"John" wrote in message
...
Aaaaaah, I had another Change event in the same worksheet Bob that changes

a
different column to Proper so that why I renamed it when it wouldn't work
the first time. How would I combine the two?

Thanks again

"Bob Phillips" wrote in message
...
John,

Worksheet event code has specific names, you can't change them to

whatever
you fancy. There is no ChangeToUpper event, just a Change event

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



--

HTH

RP
(remove nothere from the email address if mailing direct)


"John" wrote in message
...
I have the attached that I wish to Capitalise all entries within a
particular worksheet in Column D9:D44, my problem is that when I enter

a
lower case value into anyone of the cells, it remains lowercase, what

am
I
doing wrong?

Thanks



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








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Upper Case on Input Q

Presumably, they work on separate ranges, so test individually,like


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("D9:D44")) Is Nothing Then
'do one thing
ElseIf Not Intersect(.Cells, Range("A1:A100")) Is Nothing Then
'do another
End If
End If
End With
End Sub

If they both upshift, then try something liek

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



--

HTH

RP
(remove nothere from the email address if mailing direct)


"John" wrote in message
...
Aaaaaah, I had another Change event in the same worksheet Bob that changes

a
different column to Proper so that why I renamed it when it wouldn't work
the first time. How would I combine the two?

Thanks again

"Bob Phillips" wrote in message
...
John,

Worksheet event code has specific names, you can't change them to

whatever
you fancy. There is no ChangeToUpper event, just a Change event

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



--

HTH

RP
(remove nothere from the email address if mailing direct)


"John" wrote in message
...
I have the attached that I wish to Capitalise all entries within a
particular worksheet in Column D9:D44, my problem is that when I enter

a
lower case value into anyone of the cells, it remains lowercase, what

am
I
doing wrong?

Thanks



Private Sub Worksheet_ChangeToUpper(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("D9:D44")) Is Nothing Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
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
convert lower to upper case automatically without using UPPER Sal Excel Discussion (Misc queries) 6 July 26th 09 11:27 AM
Changing multiple cell text from lower case to upper case Patti Excel Discussion (Misc queries) 2 January 4th 08 08:35 PM
Changing upper case characters to upper/lower Richard Zignego Excel Discussion (Misc queries) 1 December 17th 07 10:09 PM
Changing file in all upper case to upper and lower case Sagit Excel Discussion (Misc queries) 15 May 30th 07 06:08 AM
How do I convert all upper case excel sheet into upper and lower . DebDay Excel Discussion (Misc queries) 1 March 9th 05 08:31 PM


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