Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Capital letters in cells

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hk@rygestopkonsulenterne.dk - 28 Nov 2007 10:34 GMT
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
Zone - 28 Nov 2007 10:50 GMT
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

> HI
>
[quoted text clipped - 6 lines]
>
> Henrik
Mike H - 28 Nov 2007 10:51 GMT
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

> HI
>
[quoted text clipped - 6 lines]
>
> Henrik
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.