How to select range by using named ranges in cell address

mdd16

Board Regular
Joined
Jan 11, 2011
Messages
84
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a two cells "A10" named TabBeg and "Axx" named TabEnd. I use these two named cells to mark beginning and end of table. The no of rows between these two cells keeps changing with use.

For example at a particular moment I have A10 as TabBeg and A20 as TabEnd

In "B11" to "B19" I have some strings which can contain "/" character. I need use these strings in file names that I create along the way. Since windows won't allow "/" in the file names I have to change them to "-" by using find-replace method.

Problem :
How do I select the range between B11 and B19 ( and the row number 19 would keep changing dynamically with use) by using TabBeg and TabEnd.
and apply find-replace code.

Sorry if it is too much ask.. and thanks in anticipation of help.
 

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.
Range("B" & Range("TabBeg").Row + 1 & ":B" & Range("TabEnd").Row - 1).Replace What:="/", Replacement:="-", LookAt:=xlPart
 
Upvote 0
Range("B" & Range("TabBeg").Row + 1 & ":B" & Range("TabEnd").Row - 1).Replace What:="/", Replacement:="-", LookAt:=xlPart
Stephen..Thanks for your support..I was looking to solve this sort of offset selection for a long time..

This method of selection of range will be useful for me in many situations

The original problem I solved with a better solutions. When I am picking the string, I am now replacing the "/" there

strFilename = Replace(strFilename, "/", "-")
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,472
Members
449,087
Latest member
RExcelSearch

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