View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Need Help with Macro

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "C:C" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsNumeric(.Value) Then
If IsNumeric(.Offset(0, -1).Value) Then
.Offset(0, -1).Value = .Offset(0, -1).Value - .Value
.Value = ""
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

" wrote in
message ...
COL A: Items
A1: "Item 1"
A2: "Item 2"
A3: "Item 3"

COL B: Current Balance
B1: "100"
B2: "150"
B3: "205"

COL C: USED
C1:
C2:
C3:

I need a Macro wriiten to subtract Column C from Column B; update Column B
of the current balance and delete the number used at column C as soon as
the
current balance is updated.

I hope I'm clear with my request. Thanks in advance.