Convert a string to a Range??

websmythe

New Member
Joined
Apr 1, 2009
Messages
16
Hi, I'm working in Excel 2003. Is there a way to convert strings to Ranges on the Excel commandline?

I have a lookup function in an estimate sheet that uses 2 ranges, stored as strings, in another worksheet. They are used to return a price from another workbook. When I use named ranges to access them with the lookup function, it doesn't work. But when I cut and paste the strings into the commandline it works prefectly??

I'm stumped... I've looked everywhere I can think of, could anyone offer some suggestions? Thanx.

Code:
$A10 = Part Number to search for
 
MaterialOptions is a named Range 
eg: '[Catalog.xls]PriceList'!$A$13:$A$17
 
PriceOptions is a named Range  
eg: '[Catalog.xls]PriceList'!$Z$13:$Z$17
 
LOOKUP($A10,MaterialOptions,PriceOptions) = #VALUE!
But...
LOOKUP($A10,'[Catalog.xls]PriceList'!$A$13:$A$17,'[Catalog.xls]PriceList'!$Z$13:$Z$17) = Success!
 
To use thos functions in VBA you have to qualify them with their parent, the WorksheetFunction object. Example:

Code:
x = WorksheetFunction.VLookup("Range("A1").Value, Range("B1:C100"), 2, False)

Just wanted to say thanks again for the help. Much apreciated. Using worksheetfunction has really payed off. I ended up stumbling across some info on using INDEX and MATCH together which helped solve the problem.
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

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