A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how can i make a cell always show text in caps



 
 
Thread Tools Display Modes
  #1  
Old August 13th, 2004, 01:29 PM
Alan
external usenet poster
 
Posts: n/a
Default

This code will do it, you need to name the columns as a named range that you
want it to apply to, in the this code the ranges are named 'Input' but
obviously you can use any name. If you are unfamiliar with naming ranges or
using code post back and I (or someone else!) will give advice,
Regards,
Alan.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("Input")) Is Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
End Sub

"thomas donino" wrote in message
...
I want to set up certain columns in my spreasheet so that all text entered
into it shows in caps



  #2  
Old August 13th, 2005, 12:57 PM
thomas donino
external usenet poster
 
Posts: n/a
Default how can i make a cell always show text in caps

I want to set up certain columns in my spreasheet so that all text entered
into it shows in caps
  #3  
Old August 13th, 2005, 01:21 PM
JE McGimpsey
external usenet poster
 
Posts: n/a
Default

If you have a formula, use the UPPER() function. Assuming your cell is
user-entered, you'd need an event macro. For example. put this in your
worksheet code module (right-click on the worksheet tab and choose View
Code):

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



In article ,
"thomas donino" wrote:

I want to set up certain columns in my spreasheet so that all text entered
into it shows in caps

  #4  
Old August 13th, 2005, 04:32 PM
JE McGimpsey
external usenet poster
 
Posts: n/a
Default

Two quibbles -

This code assumes that there's only one cell selected. If Range("Input")
was defined as cell J1, and cells A1:J10 were selected, cell A1 would
be coerced to upper case, not J1.

Also, without disabling events, assigning the value will create a
recursive call to Worksheet_Change, which will terminate when XL runs
out of stack space. Fortunately, XL terminates nicely, in that case, but
it's not good practice.


In article ,
"Alan" wrote:

This code will do it, you need to name the columns as a named range that you
want it to apply to, in the this code the ranges are named 'Input' but
obviously you can use any name. If you are unfamiliar with naming ranges or
using code post back and I (or someone else!) will give advice,
Regards,
Alan.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("Input")) Is Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
End Sub

"thomas donino" wrote in message
...
I want to set up certain columns in my spreasheet so that all text entered
into it shows in caps

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Box & Text Box AccessRookie Using Forms 3 April 6th, 2005 11:33 PM
Change font of part of text John Powerpoint 7 March 15th, 2005 10:10 AM
Concatenatd fields in a query for a searching form Marc Running & Setting Up Queries 8 October 19th, 2004 08:49 PM
IF E3 & E10 = TRUE set this cell to "Yes", else set to "No" Timothy L Worksheet Functions 5 August 27th, 2004 02:28 AM
Convert a Cell Reference to Text Chuck Buker Worksheet Functions 6 September 22nd, 2003 05:04 PM


All times are GMT +1. The time now is 05:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.