JohnZ1156
Board Regular
- Joined
- Apr 10, 2021
- Messages
- 180
- Office Version
- 2021
- Platform
- Windows
I have the following VBA Script entered in "View Code" on the sheet tab.
I understand what it's doing, but I'd like to know if there's a better way.
Initially, I was only concerned with converting text cells in Column C to Upper Case. Now, I'd like to enter a formula into a cell within Column C.
The VBA Script converts all of the Text cells in Column C to upper case, the problem is that if I type a formula in a cell in column C, it converts the formula to a value.
I'd like the script to convert text cells to upper case, but at the same time do not convert formulas to their values.
Is there a better way?
I understand what it's doing, but I'd like to know if there's a better way.
Initially, I was only concerned with converting text cells in Column C to Upper Case. Now, I'd like to enter a formula into a cell within Column C.
The VBA Script converts all of the Text cells in Column C to upper case, the problem is that if I type a formula in a cell in column C, it converts the formula to a value.
I'd like the script to convert text cells to upper case, but at the same time do not convert formulas to their values.
Is there a better way?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("c:c")) Is Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
Application.EnableEvents = True
End Sub