A
AA Arens
Hi,
(A) I do have undermentioned script, but I cant't get it worked. I
want to have cells changed to uppercase after Enter-command.
(B) How to have this script for all sheets, so to have it on workbook
level? And, how to avoid that other excel documents that are opened
also have the text capitalized?
Thank you.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Error_handler
With Target
If Not .HasFormula Then
Application.EnableEvents = False
If Target.Row = 10 Then Target.Value = UCase(Target.Value)
Target.Value = UCase(Target.Value)
Application.EnableEvents = True
End If
End With
Error_handler:
Resume Next
Const WS_RANGE As String = "D4:AJ380"
On Error GoTo Error_handler
Application.EnableEvents = False
With Target
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
If Not Target.HasFormula Then
Target.Value = UCase(Target.Value)
End If
End If
End With
Error_handler:
Application.EnableEvents = True
(A) I do have undermentioned script, but I cant't get it worked. I
want to have cells changed to uppercase after Enter-command.
(B) How to have this script for all sheets, so to have it on workbook
level? And, how to avoid that other excel documents that are opened
also have the text capitalized?
Thank you.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Error_handler
With Target
If Not .HasFormula Then
Application.EnableEvents = False
If Target.Row = 10 Then Target.Value = UCase(Target.Value)
Target.Value = UCase(Target.Value)
Application.EnableEvents = True
End If
End With
Error_handler:
Resume Next
Const WS_RANGE As String = "D4:AJ380"
On Error GoTo Error_handler
Application.EnableEvents = False
With Target
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
If Not Target.HasFormula Then
Target.Value = UCase(Target.Value)
End If
End If
End With
Error_handler:
Application.EnableEvents = True