ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   product calculation in excel (https://www.excelbanter.com/excel-worksheet-functions/36568-product-calculation-excel.html)

JCLim

product calculation in excel
 
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.

JE McGimpsey

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




In article ,
"JCLim" wrote:

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.



All times are GMT +1. The time now is 02:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com