# Multiplying Macro Help

#### pennstate710

##### New Member
Hi - I am trying to run a macro that would multiply 3 cells in my sheet by 2 and subsequently replace those original numbers by the multiplies numbers. Looking to have this accomplished by tying it to a shape click

FOr example:
K2 = 2
L2 = 0
M2 = 6

Looking to click a shape tied to a macro and multiply each of those by 2 and then enter that number in K2, L2, M2

Any thoughts?

Thanks

### Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

#### JimM

##### Well-known Member
I'm sure there is a more elegant way but

Sub doubleup()

For Each c In Range("k2:m2")

c.Value = c.Value * 2

Next c

End Sub

#### t0ny84

##### Board Regular
VBA Code:
``````Sub countr()
Dim cell1 As Integer
Dim cell2 As Integer
Dim cell3 As Integer

cell1 = ActiveSheet.Range("A1").Value
cell2 = ActiveSheet.Range("A2").Value
cell3 = ActiveSheet.Range("A3").Value

ActiveSheet.Range("A1") = cell1 * 2
ActiveSheet.Range("A2") = cell2 * 2
ActiveSheet.Range("A3") = cell3 * 2
End Sub``````

Just need to change the A1, A2, A3 to be your cell references.

#### Fluff

##### MrExcel MVP, Moderator
Another option
VBA Code:
``````Sub pennstate()
With Range("K2:M2")
.Value = Evaluate("If({1}," & .Address & " * 2)")
End With
End Sub``````

Replies
1
Views
246
Replies
6
Views
318
Replies
5
Views
94
Replies
0
Views
250
Replies
3
Views
274

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,152,579
Messages
5,770,958
Members
425,653
Latest member
UNSING

### 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.

### Which adblocker are you using?

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

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