VBA to enter formulas in defined range on multiple sheets

CutterSoilMixing

New Member
Joined
Jun 8, 2019
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hello everyone!

I have excel files with multiple sheets and would need a VBA to enter formulas in defined ranges on each of the sheets in the book. To make it all a little trickier the formulas would have to be entered from sheet 3 onwards (sheet 1 and 2 have to be left untouched). If that makes it massively more complicated I could work with something that just adds the formulas on all sheets in the book. These are the formulas and ranges for each sheet:

range(AV66:AV30000), =ROUND(A66,2) -> A66 would have to be A67, A68...A30000

range(AW66), =TIMEVALUE(B37)

range(AV67:AV30000), =IF(AR67<>"",AW66+1/86400,"") ->again, the cell references in the formula would have to be progressive, i.e.: AR68, AR69...AR30000 and AW67, AW68...AW30000

range(AX66), =0

range(AX67:AX30000), =IF(AW67<>"",AX66+1/60,"") -> progressive cell references required here as well

I have as good as no experience in VBA and have previously relied on finding code online to use but I can't seem anything that does what I need here. Any piece of code/advice is much appreciated!

Thanks!
 
That's it! Takes a bit longer now to run the code (which makes sense and is not a problem at all) but makes all subsequent calculations so much quicker.

Thanks Peter for all your help!
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,215,444
Messages
6,124,891
Members
449,194
Latest member
JayEggleton

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