auto adjust cell formula

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,602
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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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,215,580
Messages
6,125,653
Members
449,245
Latest member
PatrickL

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