Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic range

Status
Not open for further replies.

sabascal

IS-IT--Management
Aug 20, 2002
85
GB
Hi all here is my problem:

-Let's say I have a range defined in my spreadsheet under the name of "test" =Sheet1!$A$1:$B$10

I want to define an another range:
1) I can access with a simple name "test1" for example
2) That is return by a sub procedure that resize "test" range.

Here is what I tried:
-------------------------------------------
Sub RgResice(currentRg As Range)
Dim rowResize, ColResize
Set test1 = currentRg.Resize(rowResize, ColResize)
End Sub
--------------------------------------------------
I understand test1 is a range object. How can I refer it in my spreadsheet.
I guess I should define it as for "test" saying:
Insert> Name "test1"= RgResize(Range("test")) ????

Thanks in advance.
Seb
 
Hi,

Dosn't seem to me that your subroutine has resized anything. RowSize & ColSize have no values.

You asked how to refer to Test1 in your sheet. You would use it in a formula that referrs to a range -- like a lookup formula...
Code:
=VLOOKUP(A1,Test1,2,FALSE)
would lookup the value contained in A1 in the first column of Test1 and return the correstpoding value in the second column.

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top