ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,736
- Office Version
- 2007
- Platform
- Windows
Hi,
I habe these two codes.
When i try & merge them together i come up with the code below.
Now when i type on the sheet in question i dont see any error messages BUT i also dont get the small case changed to uppercase.
Basically,
The only text on this sheet that needs to be uppercase is as follows.
J1:M3
J4:M4
L5:M35
Other cells are either date ex 13/08/2019 or cost values ex £24.99
Or if you advise something that will just cover the whole range below thats fine.
J1:M38
I habe these two codes.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)If Intersect(Target, Range("J1:M3")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
Application.EnableEvents = True
End Sub
Code:
Private Sub Worksheet_Change(ByVal Target As Range) With Target
If .Column = 10 Then Exit Sub
If .Column = 11 Then Exit Sub
If .Count = 1 And Not .HasFormula Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End With
End Sub
When i try & merge them together i come up with the code below.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)If Intersect(Target, Range("J1:M3")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Value = UCase(Target.Value)
Application.EnableEvents = True
With Target
If .Column = 10 Then Exit Sub
If .Column = 11 Then Exit Sub
If .Count = 1 And Not .HasFormula Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End With
End Sub
Now when i type on the sheet in question i dont see any error messages BUT i also dont get the small case changed to uppercase.
Basically,
The only text on this sheet that needs to be uppercase is as follows.
J1:M3
J4:M4
L5:M35
Other cells are either date ex 13/08/2019 or cost values ex £24.99
Or if you advise something that will just cover the whole range below thats fine.
J1:M38