C
Connie Martin
Quite some time ago I posted a question on this database regarding 'forcing
uppercase' and was given two macros, which I've used time and time again:
one to force the entire worksheet to uppercase and the other one was to
select just certain ranges to be uppercase, no matter how they were typed.
Neither one of the macros is quite right for what I need now. I need a macro
for just one cell.
Here's the macro I have to force the entire worksheet to uppercase:
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If Not .HasFormula Then
.Value = UCase(.Value)
End If
End With
End Sub
This is the macro I have to force certain ranges to upper case:
Private Sub Worksheet_Change(ByVal Target As Range)
if target.cells.count > 1 then exit sub
If Not (Application.Intersect(Target, Range("B18:B100,F18:F100")) Is
Nothing) _
Then
With Target
If Not .HasFormula Then
application.enableevents = false
.Value = UCase(.Value)
application.enableevents = true
End If
End With
End If
End Sub
How do I modify either macro to be just one cell?
Connie
uppercase' and was given two macros, which I've used time and time again:
one to force the entire worksheet to uppercase and the other one was to
select just certain ranges to be uppercase, no matter how they were typed.
Neither one of the macros is quite right for what I need now. I need a macro
for just one cell.
Here's the macro I have to force the entire worksheet to uppercase:
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If Not .HasFormula Then
.Value = UCase(.Value)
End If
End With
End Sub
This is the macro I have to force certain ranges to upper case:
Private Sub Worksheet_Change(ByVal Target As Range)
if target.cells.count > 1 then exit sub
If Not (Application.Intersect(Target, Range("B18:B100,F18:F100")) Is
Nothing) _
Then
With Target
If Not .HasFormula Then
application.enableevents = false
.Value = UCase(.Value)
application.enableevents = true
End If
End With
End If
End Sub
How do I modify either macro to be just one cell?
Connie