auto adjust cell formula

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,604
Office Version
  1. 365
Platform
  1. Windows
Hi all

In cell A1 I have a simple formual that at certain times I want it to be changed to add a value of 7

So the formula at the moment is
Code:
=$B384

when my macro is run I want that formula to be then increased by 7 so on this example A1 would now be
Code:
=$B391

any ideas how to incorportae this into my code?

thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Here is a small snippet code that should do that. Modifed to suit your needs.

Code:
Sub MyIncrementFormula()
'   Change formula in cell A1 to increase it by seven rows every time this macro is run
    Range("A1").Formula = "=$B" & Right(Range("A1").Formula, 3) + 7
   
End Sub
 
Upvote 0
Hey Joe4

thats just perfect..thanks so much for taking the time to help with my post

regards
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,219
Members
452,895
Latest member
BILLING GUY

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