Write a Jagged array containing value and FormulaR1C1 to excel.

jayakrishnangounder

New Member
Joined
Feb 12, 2020
Messages
2
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
Platform
  1. Windows
I have a jagged array containing normal values and formulas in R1C1 notation and I want to write it into excel.

I used following code for the same

VBA Code:
dataRange.Value2 = jaggedArray;

But it produced unexpected results in case of column anchored formulas like '=$A1'.

I got it fixed by rewriting the code:

VBA Code:
dataRange.FormulaR1C1 = jaggedArray;

But I am not sure whether it's a perfect solution for my situation.

Thanks.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
If it works OK, then it is the perfect solution.

Indeed if the array contains formulas then you write them back to the sheet using
VBA Code:
Range.Formula = myArray  'or
Range.FormulaR1C1 = myArray 'depending on how the formulas are stored
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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