predefined range being modified during tool run and giving error

01's

Board Regular
Joined
Jun 1, 2011
Messages
85
Hi,

I got a problem related to ranges. In a worksheet I select a range AB9 to AB50 and then name it as range1. When I delete or insert rows in the sheet I find the definition of range changes eg. from AB9 to AB 20 if I delete 30 rows. Same happens if i insert rows, the definition of range changes.

This happens during VBA script run where code for insertion/deletion are embedded.
How can I avoid change of range definition. :confused:
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi,

I define this range in an excel sheet. Not in my macro.
So when I use BELOW formula in name manager the range is not seen in drop down menu list in left corner.
Confused :( Below is what I defined.
=OFFSET(INDIRECT("BS!AB9"),0,0,1000,1)

Also I use the range name in some formulas and they show "#N/A" after I change the definition to above.

where am I going wrong?
 
Upvote 0
It makes no difference how you define it - VBA or manually.
Dynamic names and those consisting of functions won't show up in the drop-down menu - this is normal.

Not sure why you're using INDIRECT, and you should be referring to row 1 and then offsetting by 8 rows. If you refer to row 9, you'll still experience the same problem.
 
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,317
Members
452,905
Latest member
deadwings

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