View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Tim Zych Tim Zych is offline
external usenet poster
 
Posts: 389
Default Use a formula to define a range

Dynamic named range:

Insert - Name - Define.

Create a name and type in the Refers To box:

=OFFSET(Sheet1!$A$1,0,0,Sheet1!$B$1,1)

Which will use B1 as the row count starting in A1.

If you type in, say, 100, in B1, then go to the VBE in the immediate window:

?range("MyRng").Address

result:
$A$1:$A$100

--
Tim Zych
SF, CA

"thewizz" wrote in message
...
I actually have 2 questions:
#1 - I would like to define a range (Say A1:A?) by using a number that is
stored in a cell (say B1) where B1 can be change if I want to look at a
different range (shorter or longer). Ex: if B1=10 then range would be
A1:A11
if B1=6 than the range would be A1:A7....

#2 - This one will probably involve VB which I am not very familiar with
(I
have used it in the past but not often enough to remember).

I would like to populate field of rows and columns depending upon data
that
I import and how much data is there. Now I have a formula copied into
about
30,000 cells in a column that calculate the data that I import, but the
Excel
file is way to big before I even start.

Thank you for any help!

--
I am not where I intended to go, but I think I am where I am supposed to
be!