1. (ActiveCell.Formula=UCase(ActiveCell)
2. Target.Value=UCase(Target.Value)
The problem is that you must exit the cell and then reselect it for
the change to take effect.
Is there any way to make this work so that the cell is converted to all
capitals when you exit the cell, without the time consuming requirement of
reselecting the cell?
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim TheCell As Range
For Each TheCell In Target
If Not Application.Intersect(TheCell, Range("A1:A10")) Is Nothing
Then
TheCell.Value = UCase(TheCell.Value)
End If
Next TheCell
End Sub
For more info about programming Event Procedures, see the "Events"
page on my web site.
Cordially,
Chip Pearson
http://home.gvi.net/~cpearson/excel.htm
Patrick C. Simonds wrote in message
<#6YgmtPG#GA....@uppssnewspub05.moswest.msn.net>...
--
David E. Hulme
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim TheCell As Range
Application.EnableEvents = False
For Each TheCell In Target
If TheCell.HasFormula = False Then
If Not Application.Intersect(TheCell, Range("A1:A10")) Is
Nothing Then
TheCell.Value = UCase(TheCell.Value)
End If
End If
Next TheCell
Application.EnableEvents = True
End Sub
Cordially,
Chip Pearson
http://home.gvi.net/~cpearson/excel.htm
Patrick C. Simonds wrote in message ...