Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Dynamic range

I need a way to determine a dynamic range in order to reference it in a
formula. The range I need to reference is in column B but the beginning row
will change each time and the length of the range will also vary. I tried
using an offset formula I found on the Contextures web site,
=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1) but I could not make it work,
perhaps because the starting row (and the name of the worksheet) will vary.
Can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Dynamic range

Hi,

give a name to Sheet1!$A$1 like "myStart", give a name to Sheet1!$A:$A
like "myData". Then define a range "myNamedData" with the formula (in
menu Insert/Name/Define write in "refers to")

=offset(mystart, 0, 0, counta(mydata), 1)

if you want colum B to represent "myNamedData" then you have to adjust
your formula to

=offset(mystart, 0, 1, counta(mydata), 1)

I do not see a problem with this if you are moving around your colum A
(mystart and mydata) within the workbook, just make sure you move the
whole range.

regards

arno


"FinChase" schrieb im Newsbeitrag
...
I need a way to determine a dynamic range in order to reference it in

a
formula. The range I need to reference is in column B but the

beginning row
will change each time and the length of the range will also vary. I

tried
using an offset formula I found on the Contextures web site,
=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1) but I could not make

it work,
perhaps because the starting row (and the name of the worksheet) will

vary.
Can anyone help?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Dynamic range

Thanks for your reply. I was able set up the dynamic range as you suggested.
I made a few changes in the name to suit my project. However, the starting
place doesn't seem to move when I do a filldown. I am trying to use it as
part of the following formula: =IF(COUNTIF(JData,BData)=0,Bdata,"") If the
initial starting place for the range was B42, it appears to stay at B42 even
when I use fill down, so I'm not really checking for unique entries in the
two lists of data.

"arno" wrote:

Hi,

give a name to Sheet1!$A$1 like "myStart", give a name to Sheet1!$A:$A
like "myData". Then define a range "myNamedData" with the formula (in
menu Insert/Name/Define write in "refers to")

=offset(mystart, 0, 0, counta(mydata), 1)

if you want colum B to represent "myNamedData" then you have to adjust
your formula to

=offset(mystart, 0, 1, counta(mydata), 1)

I do not see a problem with this if you are moving around your colum A
(mystart and mydata) within the workbook, just make sure you move the
whole range.

regards

arno


"FinChase" schrieb im Newsbeitrag
...
I need a way to determine a dynamic range in order to reference it in

a
formula. The range I need to reference is in column B but the

beginning row
will change each time and the length of the range will also vary. I

tried
using an offset formula I found on the Contextures web site,
=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1) but I could not make

it work,
perhaps because the starting row (and the name of the worksheet) will

vary.
Can anyone help?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Dynamic range

Hi,

If the
initial starting place for the range was B42, it appears to stay at

B42 even
when I use fill down


that's clear. Use B42 instead of a name if you want it to be flexible
when copying the formula.

arno

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Dynamic range

My problem with that is that I need to insert the formula with VBA and make
it so that my users only click a few buttons--they shouldn't even touch the
formula. The column will always be B, but the starting row will change. I
just wish there was a way to tell it to use the active cell.

"arno" wrote:

Hi,

If the
initial starting place for the range was B42, it appears to stay at

B42 even
when I use fill down


that's clear. Use B42 instead of a name if you want it to be flexible
when copying the formula.

arno




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Dynamic range

Hi Fin,

My problem with that is that I need to insert the formula with VBA


record a macro when you type in the formula. this formula will use
relative addresses. in your VBA select the cell and use the recorded
formula there.

arno

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic range Flipper Excel Discussion (Misc queries) 3 August 20th 09 06:03 PM
Dynamic SUM range Carl Excel Worksheet Functions 8 October 30th 07 08:03 AM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Excel 2000 VBA - Set Print Range in dynamic range sub_pop[_5_] Excel Programming 2 July 27th 04 08:01 PM
Dynamic range Victor[_3_] Excel Programming 3 July 13th 04 07:19 PM


All times are GMT +1. The time now is 12:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"