VBA code to extend or shrink table with formulas

DarkSmile

Board Regular
Joined
Feb 22, 2021
Messages
90
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm making a kind of control panel in Excel with buttons to do different actions automatically.
What I'm looking to do now is press a button and say go to workbook x look at sheet x -> look the amount of cells that have data and extend in sheet x and resize the table to the same amount

Example:

Go to workbook: template bo4 extract.xlsx -> Sheet: base 2
Look at column "A" = 173720 rows with data
1637935636328.png


Now go (same workbook) to sheet CA TOT
Extend or shrink table (with formulas) to the same amount -> Important it needs to extend the formulas with it and if shrinking it needs to delete the formulas that are N/A anymore
1637935792416.png


Is there a way to do this? I hope I explained it well enough.
All this is done from another workbook so important to say go to workbook x

Thnx,
David
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,214,885
Messages
6,122,085
Members
449,064
Latest member
MattDRT

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