Set Range for Dynamic Array from other workbook

StijnRoelen

New Member
Joined
Sep 8, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm a bit of a novice to VBA so I'm trying my best to explain my goal but excuse me if the explanation is a bit unclear

I'm trying to reference a range of cells in another workbook with a dynamic array like so:

VBA Code:
With ActiveSheet
   .Cells(12, 14).Formula2R1C1 = _
        "='[workbook.xlsm]Sheet1'!R14C5:R15C5"
End With

Except, i want the size of the range to correspond with a number in a different cell in the active workbook.
For example the "amount of rows" cell says 4, I need the referenced range from the external workbook to be R14C5:R17C5 in Cell R12C14 in the active workbook and spill 3 rows over

Thanks in advance!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
By the way, eventually I'm going to run this for multiple external worbooks so they will be closed
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,699
Members
449,048
Latest member
81jamesacct

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