P
Phil H.
A worksheet has 13 column ranges (L21:L37, P21
37, AC21:AC37, etc
requiring upper case if the user inputs lower case. The following cod
does the job for L21:L37; however, upon a worksheet change, a compil
error occurs on the code for P21
37 - Ambiguous name detected
Worksheet_Change. The first line of P21 code (Private Sub...) i
highlighted.
In the worksheet code sheet, the same code (with the range changed) ha
been entered once for each of the 13 ranges, trying to get around th
problem of not being able to make a single sub to the work for all 1
ranges. Could someone suggest a solution for getting the 13 colum
ranges to change lower case to upper case?
Private Sub Worksheet_Change(ByVal Target As Range)
'Forces text to UPPER case for the range L21:L37
If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub
On Error Resume Next
If Not Intersect(Target, Range("L21:L37")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
On Error GoTo 0
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
'Forces text to UPPER case for the range P21
37
If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub
On Error Resume Next
If Not Intersect(Target, Range("P21
37")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
On Error GoTo 0
End Su
requiring upper case if the user inputs lower case. The following cod
does the job for L21:L37; however, upon a worksheet change, a compil
error occurs on the code for P21
Worksheet_Change. The first line of P21 code (Private Sub...) i
highlighted.
In the worksheet code sheet, the same code (with the range changed) ha
been entered once for each of the 13 ranges, trying to get around th
problem of not being able to make a single sub to the work for all 1
ranges. Could someone suggest a solution for getting the 13 colum
ranges to change lower case to upper case?
Private Sub Worksheet_Change(ByVal Target As Range)
'Forces text to UPPER case for the range L21:L37
If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub
On Error Resume Next
If Not Intersect(Target, Range("L21:L37")) Is Nothing Then
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
On Error GoTo 0
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
'Forces text to UPPER case for the range P21
If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub
On Error Resume Next
If Not Intersect(Target, Range("P21
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
End If
On Error GoTo 0
End Su