How to get multiple cells to multiply different figures

Shesmi130

New Member
Joined
Nov 1, 2017
Messages
7
I have used the formula below to get a specific set of cells to produce a multiplied figure, however it will only work for one row. Each time I change the details in the formula to include another row it deletes the info that was added for the previous row. Is there a way to use the formula on multiple rows that have different values? For example, I need C3:I3 to multiply by 10 but I need C5:I5 to multiply by 18.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit
Const SET_VALUE As Long = 23 '<== 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 .Value = .Value * SET_VALUE
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub
 
Hi! Can you help me in creating a drop down list that can select multiple options. I got a code that can select multiple options but it is separated with comma. My client wants it separate in different cell under the same column. Please I need some help with this. Thank you in advance.
Please do not post your unrelated questions to someone else's threads! That is known as "thread hijacking". Please post your question to its own thread.
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

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