Automatically multiple the inputted value on a cell

TheLSD

New Member
Joined
Jan 12, 2022
Messages
33
Office Version
  1. 2010
Platform
  1. Windows
1646620483287.png


Can I make value that I input on a cell automatically multiplied by a specific cell? Like the picture above, if I input "1" on column "Jan" then I press enter, it will automatically multiplied to "price" column so 1 times 1500. Other, if I input "3" on "Jan", then it will become "4500"
Thank you!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Will you be using only Jan (column K) or do you also want to do this for all 12 months in the columns to the right of Jan? As well, will you have more than one asset in column H?
 
Upvote 0
Will you be using only Jan (column K) or do you also want to do this for all 12 months in the columns to the right of Jan? As well, will you have more than one asset in column H?
yep I will do for all 12 months and more than one asset
 
Upvote 0
Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. The macro assumes the months are in the range K1:V1.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("K:V")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    Target.Value = Target.Value * Range("J" & Target.Row).Value
    Application.EnableEvents = True
End Sub
 
Upvote 0
Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. The macro assumes the months are in the range K1:V1.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("K:V")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    Target.Value = Target.Value * Range("J" & Target.Row).Value
    Application.EnableEvents = True
End Sub
If I put nothing on Qty Column, can I insert any number on the month's columns?
Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. The macro assumes the months are in the range K1:V1.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("K:V")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    Target.Value = Target.Value * Range("J" & Target.Row).Value
    Application.EnableEvents = True
End Sub
sorry for the late response
I try to change the range and the target value but when I try to insert the value, it won't multiple it
any idea?
here's the code with my customization
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("d:o")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    Target.Value = Target.Value * ThisWorkbook.Sheets(2).Range("C" & Target.Row).Value
    Application.EnableEvents = True
End Sub
 
Upvote 0
It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach screenshots (not a pictures) of Sheet2 and the sheet containing the target. Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,780
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top