Can i make the result of a text-input uppercase in a cell?

XiniX

Board Regular
Joined
May 1, 2002
Messages
57
I have a sheet where users must input two letters of the postal-code, and the result must be uppercase regardless what the keyboard settings are at the moment of the input. Is there a ucase Cell preset-setting of that column, or do i have to build it into a macro after the input is done. Can anyone help me with this problem?
 
What modification would the dark side apply to that code?

Aladin

Alas and alack, no less.

Well, you have two options.

You could put this code into the "Admin" sheet_change event. Simple as that. (i.e. put it on the Admin sheet object, or right-click Admin worksheet tab, view code and put it in there)

The other option would be to put it into the "ThisWorkbook"'s SheetChange event. In which case you would specify the sheet. The Sheetchange Event code looks like this:

<pre>Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name = "Admin" Then
'Jay's code here
End If
End Sub</pre>

You know, it's actually kind of hard to explain some things. So I apologise for my wording.
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Argh!!! I had another brainfart. Now I've read your message correctly:

<pre>
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = Sheets("Admin").Range("A1").Value Then Target = UCase(Target)
End Sub </pre>

Phew.

Right, I'm going off the board, I can't read posts correctly when I've got other stuff to do. :biggrin: (apparently)
 
Upvote 0
On 2002-05-02 07:27, Mark O'Brien wrote:
Argh!!! I had another brainfart. Now I've read your message correctly:

<pre>
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = Sheets("Admin").Range("A1").Value Then Target = UCase(Target)
End Sub </pre>

Phew.

Right, I'm going off the board, I can't read posts correctly when I've got other stuff to do. /board/images/smiles/icon_biggrin.gif (apparently)

Yes, Mark, this is what I wanted to know.

:biggrin:

Aladin
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,202
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top