Force upper case?

  • Thread starter Trevor Coultart
  • Start date
T

Trevor Coultart

Hi all,

Does anyone know of a way I can force cell contents to appear in uppe
case? I'm tidying up a worksheet that is completed by many users an
one of the columns is for a reference code which has three letters an
six numbers (ABC123456). Some users leave it in lower case, and th
resulting sheet looks a mess.

Can I get Excel to always display this column in upper case regardles
of what the user inputs?

Trevo
 
B

Bob Phillips

Trevor,

Try this

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("H1:H10")) Is Nothing Then
With Target
.Value = UCase(.Value)
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob Phillips

"Trevor Coultart"
 
G

Guest

a helper column with =UPPER(H1) abc456 in cell H1 was converted to ABC456 in
my helper cell.....
 
T

Trevor Coultart

Many thanks for the responses. I've used a combination: "upper" to
convert all the existing entries and Bob's magic formula to ensure that
it stays looking tidy. (Bob - thanks. I have not the faintest idea how
that works but it does.)

Trevor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top