Changing the range of a named range (special)

luzikedy

New Member
Joined
May 23, 2014
Messages
45
Hi All,

I need for my project the following:

My range has to have always 1500 rows down from from a specific cell that is described by a value in cell B1.

I have a named range called Myrange with this area covered $A$1:$A$1500 and in a cell B1 I have value 1000 and I need a code that changes the range to $A$1000:$A$2500.

Thanks for help!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try the code below

Code:
Sub renameit()
Range(Cells(Range("B1").Value, "A"), Cells(Range("B1").Value + 1500, "A")).Name = "Myrange"
End Sub


Edit: was being stupid as the OP already stated the name
 
Last edited:
Upvote 0
Hi All,

I need for my project the following:

My range has to have always 1500 rows down from from a specific cell that is described by a value in cell B1.

I have a named range called Myrange with this area covered $A$1:$A$1500 and in a cell B1 I have value 1000 and I need a code that changes the range to $A$1000:$A$2500.

Thanks for help!
Do you mean?
Code:
Range("myrange").Offset([b1] - 1).Name = "myrange"

[myrange].Select  'this line is just to check
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

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