Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

How to set cell format always in negative in specific column?

$
0
0

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"?


Viewing all articles
Browse latest Browse all 88854


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>