(Solved) – How to set cell format always in negative in specific column?


enter image description here

I would like to make a simple tracking sheet for onhand stock Qty. Column F is the actual stock Qty will sum up all row cell value. the column incl. “export” (e.g. column H & J.) should be a negative value.

I have tried the following code.

Private Sub Worksheet_Change(ByVal Target As Range)

Dim isect As Range
Set isect = Application.Intersect(Target, Range("I:I"))
If Not (isect Is Nothing) Then
    If Target.Value > 0 Then Target.Value = 0 - Target.Value
End If

End Sub

it will turn the column “I” to negative automatically. However, I will add more batches in the future. Is any way automatically turn negative if the column contains “export”?

Leave a Reply

Your email address will not be published. Required fields are marked *