Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 774
- Office Version
- 365
- 2019
- Platform
- Windows
I have a formula which is fine. However, I need to tweak the Macro so Column "E" is not selected.
My current macro is:
I tried using something like
Unfortunately, that did not seem to work. Can anyone offer any suggestions.
Thank you,
My current macro is:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim R As Range, CellRange As Range
Dim CA As Variant
Dim RRow As Long, RCol As Long
Set CellRange = Me.Range("A2:N2", Me.Range("A" & Rows.Count).End(xlUp))
If Not Application.Intersect(CellRange, Target) Is Nothing Then
With CellRange
.Font.Bold = False
.Font.Size = 12
.Font.Name = "Times New Roman"
End With
CA = CellRange.Value
For RRow = LBound(CA, 1) To UBound(CA, 1)
For RCol = LBound(CA, 2) To UBound(CA, 2)
CA(RRow, RCol) = UCase(CStr(CA(RRow, RCol)))
Next RCol
Next RRow
Application.EnableEvents = False
CellRange.Value = CA 'put array values back into range
Application.EnableEvents = True
Columns.AutoFit
End If
End Sub
I tried using something like
Excel Formula:
Set CellRange = Me.Range("A2:D2, F2:M2", Me.Range("A" & Rows.Count).End(xlUp))
Thank you,