Adding to existing formulas for multiple rows in one blanket command

dmoore702

New Member
Joined
Jun 21, 2015
Messages
18
I've got 16 columns that have 20 rows that have different formulas (=Tournament!$E$14+Tournament!$E$15, =Tournament!$I$10+Tournament!$I$11), the numbers are coming from a different tab.
However, some of the columns I want to add a *2 multiple, others a *.5 addition to the existing formula. Is there any way to make blanket changes to all the rows of individual columns without heading into each individual cell??
 

Attachments

  • LEADER2.png
    LEADER2.png
    105.6 KB · Views: 4

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You haven't stated where the equations are, but this code will multiply the equations in A2 to A20 by 2, modify it to do what you want;
VBA Code:
Sub test()
inarr = Range("A2:A20").Formula
  For i = 1 To UBound(inarr, 1)
   inarr(i, 1) = "=2*(" & Mid(inarr(i, 1), 2) & ")"
  Next i
  Range("A2:A20").Formula = inarr

End Sub
 
Upvote 0
So the current equations are in columns 6-8 (there's 16 columns for individual golf tournaments). Four of the tournaments will be worth double points, so I want to take the existing formula and have it multiplied by 2, and two of the tournaments cut in half, so multiplied by 0.5. Still use that VBA code? Thanks for your help.
Dennis
 
Upvote 0
To change the equations in column 6 which is column F just change the two references "A2":A20" to "F2:F20" , i.e just change the references to change the column ,
to change the mulitplier just change the string: "=2*(" to "=0.5*("
i.e just change the constant 2 to what ever number you like.
use it as many times as you like just keep changing the references and the constant
 
Upvote 0
Solution

Forum statistics

Threads
1,215,052
Messages
6,122,878
Members
449,097
Latest member
dbomb1414

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