View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
H. Singh H. Singh is offline
external usenet poster
 
Posts: 5
Default refilling data in same cell after user input in another cell

Thank You Topper -- But how I will implement this in an worksheet.
Can it be simple. Or Where I should start learnig how to use this visual
basic things without big hasstle in short time and without taking lot of
courses and spending lots of money.
--
H. Singh


"Toppers" wrote:

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

On Error GoTo ws_exit
Application.EnableEvents = False

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

ws_exit:
Application.EnableEvents = True
End Sub

"H. Singh" wrote:

How can I reduce the value in a cell by certain number which I enter in
another cell.
eg: operator enters value 3 in cell D2 and press enter - I want the value
say 55 in cell B5 to be reduced by 3 and have 3 from D2 to be cleared and 55
becomes 52 in B5.

--
H. Singh