resize a named range

nitind

Board Regular
Joined
Oct 30, 2008
Messages
77
I have a range "A1" named array.Now I want to resize this "array" to include two more rows and keeping only one column.How to do that in VBA.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Can you show us your code please?

When you say you have a cell named "array" - do you mean a workbook level named range? If so this should work:
Code:
ActiveWorkbook.Names.Add Name:="array", RefersToR1C1:=Range("array").Resize(3)

Note, this will increase the size of the array by two rows each time the macro is run.
 
Upvote 0
Code:
Range("A1:A3").Name = "blah"
should work.
 
Upvote 0
Can you show us your code please?

When you say you have a cell named "array" - do you mean a workbook level named range? If so this should work:
Code:
ActiveWorkbook.Names.Add Name:="array", RefersToR1C1:=Range("array").Resize(3)

Note, this will increase the size of the array by two rows each time the macro is run.

What if I add the ange name using VBA
 
Upvote 0

Forum statistics

Threads
1,213,544
Messages
6,114,249
Members
448,556
Latest member
peterhess2002

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