Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

uppercase 1

Status
Not open for further replies.

Qube

IS-IT--Management
Mar 18, 2002
52
GB
Is it possible to make text entered into a cell in Excel all uppercase even if entered in lower case?

If so please explain how

Thanks

Lee
 
need to use the worksheet change event

then insert this code

target.value = uCase(target.value)

Rgds
Geoff
Si hoc legere scis, nimis eruditionis habes
 
use the ucase() fucntion in VBA or the upper() function in the worksheet
 
Wow thanks that was most helpful and very quick :)
 
Careful though, you will turn any formuls into text if you don't trap for formulas. Following is courtesy of Chip Pearson:-

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo ErrHandler
Application.EnableEvents = False
If Target.HasFormula = False Then
Target.Value = UCase(Target.Value)
End If
ErrHandler:
Application.EnableEvents = True
End Sub

Regards
Ken..............
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top