J
J@Y
Sub SheetSub()
Dim cel As Range
Dim myStr As String
For Each sh In Sheets(Array("Sheet1", "Sheet2", "Sheet3"))
For Each cel In Selection
If cel.HasFormula = True Then
If Not cel.Formula Like "=ROUND(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=ROUND(" & myStr & "," & "3" & ")"
End If
End If
Next
Next sh
End Sub
I am trying to have a macro that goes through all Sheets 1-3 and add
=Round() infront of a selection of cells. Right now, the code only performs
the function on the sheet I am currently on.
Dim cel As Range
Dim myStr As String
For Each sh In Sheets(Array("Sheet1", "Sheet2", "Sheet3"))
For Each cel In Selection
If cel.HasFormula = True Then
If Not cel.Formula Like "=ROUND(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=ROUND(" & myStr & "," & "3" & ")"
End If
End If
Next
Next sh
End Sub
I am trying to have a macro that goes through all Sheets 1-3 and add
=Round() infront of a selection of cells. Right now, the code only performs
the function on the sheet I am currently on.