product calculation in excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

can anyone advice me on the below scenerio?
eg. a * b = c

In cell A1, I input value a. I need to get c in cell A5. But b can only be
input in cell A5 too. Meaning when I key in b in cell A5, automatic c will
appears in cell A5.

Is there a way to do in excel? Please advice. Thanks.
 
You can't have both a manually entered constant and a formula in the
same cell. However you can do this with an event macro. Put this in your
worksheet code module (right-click the worksheet tab and choose View
Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If .Address(False, False) = "A5" Then
Application.EnableEvents = False
.Value = .Value * Range("A1").Value
Application.EnableEvents = True
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top