Skip to content

Instantly share code, notes, and snippets.

@faeem81
Created December 1, 2022 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faeem81/8b21e725b22d9cc340f4f6d30582f100 to your computer and use it in GitHub Desktop.
Save faeem81/8b21e725b22d9cc340f4f6d30582f100 to your computer and use it in GitHub Desktop.
How to Use VBA UCase Function
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Z As Long
Dim xVal As String
On Error Resume Next
If Intersect(Target, Range("C8:C100")) Is Nothing Then Exit Sub
Application.EnableEvents = False
For Z = 1 To Target.Count
If Target(Z).Value > 0 Then
Target(Z).Value = UCase(Target(Z).Value)
End If
Next
Application.EnableEvents = True
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment