View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Upper-case all text in Excel 2003 spreadsheet

To change existing text to upper case, use the following
procedu


Sub AAA()
Dim Rng As Range
Application.EnableEvents = False
For Each Rng In ActiveSheet.UsedRange.SpecialCells _
(xlCellTypeConstants, xlTextValues)
Rng.Value = UCase(Rng.Text)
Next Rng
Application.EnableEvents = True
End Sub

To automatically convert data entry to upper case, use the
following event procedure in the Sheet's code module (right-click
the tab and choose View Code).

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.HasFormula = True Then
Exit Sub
End If
If Target.Cells.Count 1 Then
Exit Sub
End If
Application.EnableEvents = False
Target.Value = UCase(Target.Text)
Application.EnableEvents = True
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Chris Hankin" wrote in message
...
Hello,

Could someone please advise on how I can make Excel 2003
automatically
change all text to upper-case in my spreadsheet named
"Register".

Any help would be greatly appreciated.

Thanks,

Chris.

Live Long and Prosper :-)

*** Sent via Developersdex http://www.developersdex.com ***