Worksheet Change Q
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const WS_RANGE As String = _
"J10:J22,J28:J40,J46:J58,J64:J76,J82:J94,J100:J112 ,J118:J130"
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range(WS_RANGE)) Is Nothing Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub
--
__________________________________
HTH
Bob
"Seanie" wrote in message
...
How can I select multiple ranges within a Change event code? I've
tried below but I hit debug
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("J10:J22", "J28:J40",
"J46:J58", "J64:J76", "J82:J94", "J100:J112", "J118:J130")) Is Nothing
Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub
|