I have a sheet that I enter numbers in all day in columns R:Y and there are formulas in cells I:L that change upon the data entry. I just need a bit of code that will shrink the size of the text in a cell if the result of the formula hits 4 digits or more. I never select or enter anything in the cells with the formula.
I have a code already that uses target address to run and add certain numbers together and if the new code needs to be added to it that would be fine.
I have a code already that uses target address to run and add certain numbers together and if the new code needs to be added to it that would be fine.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Cella = Target.Offset(0, -1).Value
Dim Cell As Range
For Each Cell In Target
With Cell
If .Column = Range("S:S").Column Or .Column = Range("U:U").Column Or .Column = Range("W:W").Column Or .Column = Range("Y:Y").Column _
Or .Column = Range("AU:AU").Column Or .Column = Range("AW:AW").Column Or .Column = Range("AY:AY").Column Or .Column = Range("BA:BA").Column Then
Target.Offset(0, -1) = Target + Cella
End If
End With
On Error Resume Next
Next Cell
End Sub