Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Capital letters in cells

HI

Is it possible to program a cell in Excel to convert lowercase letters
to capital letters? Ex.: I type 'e' in a cell and upon pressing enter
it changes to 'E'. If I type 'E' in the cell nothing should happen. If
I type 'Ee' it should change to 'EE'.

Thanks in advance

Henrik
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Capital letters in cells

If you only want this to happen for one particular cell (say A1), this
should work. Right-click on the sheet's tab, select View Code, and paste
this code in there. Change $A$1 to the address of the cell you want. James

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
Application.EnableEvents = True
End If
End Sub


wrote in message
...
HI

Is it possible to program a cell in Excel to convert lowercase letters
to capital letters? Ex.: I type 'e' in a cell and upon pressing enter
it changes to 'E'. If I type 'E' in the cell nothing should happen. If
I type 'Ee' it should change to 'EE'.

Thanks in advance

Henrik



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Capital letters in cells

You could,

Right click the sheet tab, view code and paste this in. Change the range to
suit your needs:-

Private Sub Worksheet_Change(ByVal Target As Range)
Const sheet_Range As String = "A1:A100" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(sheet_Range)) Is Nothing Then
Target.Value = UCase(Target.Value)
End If
ws_exit:
Application.EnableEvents = True
End Sub

Mike

" wrote:

HI

Is it possible to program a cell in Excel to convert lowercase letters
to capital letters? Ex.: I type 'e' in a cell and upon pressing enter
it changes to 'E'. If I type 'E' in the cell nothing should happen. If
I type 'Ee' it should change to 'EE'.

Thanks in advance

Henrik

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
how to change small letters to capital letters HOW TO CHANGE Excel Discussion (Misc queries) 4 May 30th 07 01:12 AM
how do i turn all letters into capital letters? KeithT Excel Discussion (Misc queries) 3 May 11th 07 02:13 PM
Capital Letters teresa Excel Programming 23 March 24th 05 03:17 PM
How do I change a column of cells to all capital letters? morpattyjo Excel Worksheet Functions 4 March 13th 05 07:59 PM
Capital Letters Gaute Excel Worksheet Functions 4 March 9th 05 09:55 AM


All times are GMT +1. The time now is 08:36 AM.

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"