Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Capitalize text upon entry in a cell

Is there a macro that will capitalize text entered into a cell? Most
of the time the text will be in a range such as A1:C3. Thanks for
your help.

Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Capitalize text upon entry in a cell

My response assumes that you want to make all the letters of a cell within
the specified range upper case immediately after hitting the Enter key for
the entry in that cell.

First off, you have to decide on the range of cells to apply this
functionality to (it can't be "most of the time"... it has to be all of the
time). I'll assume for this response that the range of cells is A1:C3 as you
mentioned. Right click the tab at the bottom of the worksheet that is to
have this functionality, select View Code from the popup menu that appears
and then copy/paste the following into the code window that you were taken
to...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1:C3")) Is Nothing Then
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
Application.EnableEvents = True
End If
End Sub

Now, go back to the work sheet and type something into any cell in the range
A1:C3... as soon as you hit the Enter key, the text you typed in will become
capitalized.

--
Rick (MVP - Excel)


"Michael Lanier" wrote in message
...
Is there a macro that will capitalize text entered into a cell? Most
of the time the text will be in a range such as A1:C3. Thanks for
your help.

Michael


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Capitalize text upon entry in a cell

Your solution works great. Thanks.

Michael
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
Capitalize text when input in cell shamor Excel Discussion (Misc queries) 1 May 21st 08 04:21 PM
In a column, how can I capitalize ALL text? singmusik04 Excel Discussion (Misc queries) 6 September 10th 07 07:56 PM
Capitalize the last character of a cell. oobe Excel Programming 2 April 18th 06 11:36 PM
Capitalize Text if 2 lists are equal elevdown New Users to Excel 5 December 15th 05 03:56 PM
Capitalize text Eddie Excel Discussion (Misc queries) 2 February 8th 05 09:19 PM


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