Excel VBA - Out of memory when create a dynamic array formula

0 votes

I want to refer to a named range in cell A1 in another cell. Simple number arrays (1, 2, 3, and 4) make up the range, which I manually typed in C3:G3 and gave the name MyArray.

Excel will display a window stating "Out of Memory" when I run my function. Is there a solution to this issue?

Sub MyArray()

Range("A1").Formula2 = "=MyArray"


End Sub
Feb 9, 2023 in Others by Kithuzzz
• 38,000 points
735 views

1 answer to this question.

0 votes

Try this:

Sub MyArray()

Range("A1").Formula2 = "=R[2]C[2]:R[2]C[6]"

End Sub

But that will only put the C3:G3 in the A1 cell as you wanted. However when I just ran a macro replacing "=R[2]C[2]:R[2]C[6]" with "=C3:G3" and using A20 or something as a target cell, it worked just fine.

answered Feb 9, 2023 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
1 answer

VBA to create a dynamic rolling list of names

If I understand you correctly, a case. ...READ MORE

answered Mar 23, 2023 in Others by narikkadan
• 63,600 points
509 views
0 votes
1 answer

Is there a maximum number of formula fields allowed in Excel (2010)

See http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP010073849.aspx for limits on specs it doesn't indicate ...READ MORE

answered Sep 30, 2022 in Others by narikkadan
• 63,600 points
850 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
1,212 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
3,662 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 23,260 points
908 views
0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,690 points
1,053 views
0 votes
1 answer

In a excel formula I need to create a list of names on one sheet based upon criteria/data of another sheet

The final formula is: =IF(ROWS($H$3:H3)<=$I$1,INDEX(Personnel! ...READ MORE

answered Nov 25, 2022 in Others by narikkadan
• 63,600 points
1,103 views
0 votes
1 answer

Getting data out of a cell with a #NAME? error in Excel VBA

If you need VBA, use .Formula: Dim f As ...READ MORE

answered Feb 3, 2023 in Others by narikkadan
• 63,600 points
653 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP