I came across the below code to fix a trailing minus sign in some data. The workbook is intended to be a template with a series of calculations from the data on 5 other worksheets. Running the code in a separate workbook completes smoothly and within a second or two. However running it in the workbook including calculations takes forever. Could this be because excel is recalculating all formulas for each change that is made?
Is there a change that could be made to fix this?
Thanks
Is there a change that could be made to fix this?
Code:
Sub Negsignleft()
Dim cell As Range
Dim rng As Range
''move minus sign from right to left on entire worksheet
On Error Resume Next
Set rng = ActiveSheet.Range("E1:F15000"). _
SpecialCells(xlCellTypeConstants, xlTextValues)
On Error GoTo 0
For Each cell In rng
If IsNumeric(cell.Value) Then
cell.Value = CDbl(cell.Value)
End If
Next cell
End Sub
Thanks
Last edited: