Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Change text to all caps

I need your help with code for changing the text within a cell to all
caps. I want to attach the code to the sub "worksheet change" event to
enable the code. For example: If someone types a lower case value into
a cell it will automatically change to uppercase.

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default Change text to all caps

See the response to your earlier thread.

John wrote:

I need your help with code for changing the text within a cell to all
caps. I want to attach the code to the sub "worksheet change" event to
enable the code. For example: If someone types a lower case value into
a cell it will automatically change to uppercase.

Thank you

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change text to all caps

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = 1 Then
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
Application.EnableEvents = True
End If
End Sub



--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Change text to all caps

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:H10")) Is Nothing Then
With Target
.Value = UCase(.Value)
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

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

"John" wrote in message
om...
I need your help with code for changing the text within a cell to all
caps. I want to attach the code to the sub "worksheet change" event to
enable the code. For example: If someone types a lower case value into
a cell it will automatically change to uppercase.

Thank you



  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Change text to all caps

The following will work for a single cell at a time

Private Sub Worksheet_Change(ByVal Target As Range)
a = Target.AddressLocal
Target.Value = UCase(Target.Value)

End Sub
-----Original Message-----
I need your help with code for changing the text within a

cell to all
caps. I want to attach the code to the sub "worksheet

change" event to
enable the code. For example: If someone types a lower

case value into
a cell it will automatically change to uppercase.

Thank you
.



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
In excel can you change words from all caps to initial caps? O2bardy Excel Discussion (Misc queries) 7 May 7th 10 03:33 PM
How do I change text from all caps to normal type? Karol Excel Worksheet Functions 3 June 20th 06 04:53 PM
How to change ALL CAPS to Initial Caps only? Robert Judge Excel Worksheet Functions 5 September 24th 05 11:14 PM
How to automatically change a single letter text entry to caps?? Bigweed New Users to Excel 5 August 8th 05 07:39 PM
Change source text in Excel from all caps to upper and lower case. JoanS Excel Discussion (Misc queries) 2 December 16th 04 02:11 AM


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