J
JOUIOUI
I'm using this code to force specific cells in my open spreadsheet to a
negative value. I'm getting an error half way through the code. It is
making the values in cells B109, B113, B65, B66, B68, B69, B71, B72 and G7
negative but errors before looking at the remaining stated cells. Can
anybody help me in fixing this code. Thank you,
Sub ForceCellsToNegative()
Dim Rng As Range
Dim rCell As Range
Set Rng =
Range("B109,B113,B65,B66,B68,B69,B71,B72,G7:G12,G24:G35,G37:G48,G50:G61,G81:G83,G86:G105,G107,G108,G111,G112")
For Each rCell In Rng.Cells
With rCell
If .Value <> "" Then
..Value = -Abs(.Value)
..Font.Name = "Arial"
..Font.Bold = True
..NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
End If
If Not Rng Is Nothing Then
Else
Exit Sub
End If
End With
Next rCell
End Sub
negative value. I'm getting an error half way through the code. It is
making the values in cells B109, B113, B65, B66, B68, B69, B71, B72 and G7
negative but errors before looking at the remaining stated cells. Can
anybody help me in fixing this code. Thank you,
Sub ForceCellsToNegative()
Dim Rng As Range
Dim rCell As Range
Set Rng =
Range("B109,B113,B65,B66,B68,B69,B71,B72,G7:G12,G24:G35,G37:G48,G50:G61,G81:G83,G86:G105,G107,G108,G111,G112")
For Each rCell In Rng.Cells
With rCell
If .Value <> "" Then
..Value = -Abs(.Value)
..Font.Name = "Arial"
..Font.Bold = True
..NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
End If
If Not Rng Is Nothing Then
Else
Exit Sub
End If
End With
Next rCell
End Sub