Help with BVA code
On Monday, July 14, 2014 6:03:00 PM UTC-7, xxdesertorxx wrote:
Hi need a code that is going to work like this:
1will be use in a cell as data input
2 will affect another cell right next to it
3 will go blank after data is entered
Ex.... the cell will be used to enter sold items, the number of sold
items will be substracted from an existing inventory count right next to
it, but then I need the cell where the sold items number was entered to
go blank again.....
I hope you understand my explanation, and if somebody can help me I will
really apretiate it, thank you very much for reading my request...
xxdesertorxx
You could try something like this in the sheet module.
Where your inventory numbers are in column B and you enter the number of sold items in column A.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
Dim sItem As Long
sItem = Target
Target.Offset(, 1) = Target.Offset(, 1) - sItem
Target.ClearContents
End Sub
Regards,
Howard
|