A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Dynamic range (column); include only rows before blank row above more data



 
 
Thread Tools Display Modes
  #1  
Old August 19th, 2004, 06:43 PM
L Mehl
external usenet poster
 
Posts: n/a
Default Dynamic range (column); include only rows before blank row above more data

Hello:

One worksheet will contain more than one table holding lookup values
(prices, CPU speed, etc.). They will be located one on top of another, with
possibly some other data between tables, separated by at least one blank
row. They will be expandable by row, as new prices, CPUs, etc. are added.

I want the range name to expand and reflect all the rows in a table.

Using a column as an example of tables,

a (in A1)
b
c

d
e
f

represent 2 tables (ranges).

Excel Hacks has the code for Define Name "Refers to" as
=OFFSET(Sheet1!$A$1,0,0,MATCH("*",Sheet1!$A$1:$A$1 00,-1),1)

This formula does not see the blank between c and d as a separator of two
ranges. It shows the range as a through f.

If I blank d, e, and f, it correctly defines the range as a through c.

Can someone tell me the code for "Refers to" that will recognize
a
b
c
as the first range?

If the code were correct, would the definition of the second range be
=OFFSET(Sheet1!$A5,0,0,MATCH("*",Sheet1!$A5:$A$100 ,-1),1)

Thanks for any help.

Stephen Mehl



  #2  
Old August 19th, 2004, 09:31 PM
Lynn Arlington
external usenet poster
 
Posts: n/a
Default

I have used the xldown command as follows:

Range("A1").Select
ActiveCell.End(xlDown).Select
LastRow = ActiveCell.Row
Range("a1:e" & LastRow).Select

This selects to column e only the rows used when pressing CTRL+DOWN




"L Mehl" wrote:

Hello:

One worksheet will contain more than one table holding lookup values
(prices, CPU speed, etc.). They will be located one on top of another, with
possibly some other data between tables, separated by at least one blank
row. They will be expandable by row, as new prices, CPUs, etc. are added.

I want the range name to expand and reflect all the rows in a table.

Using a column as an example of tables,

a (in A1)
b
c

d
e
f

represent 2 tables (ranges).

Excel Hacks has the code for Define Name "Refers to" as
=OFFSET(Sheet1!$A$1,0,0,MATCH("*",Sheet1!$A$1:$A$1 00,-1),1)

This formula does not see the blank between c and d as a separator of two
ranges. It shows the range as a through f.

If I blank d, e, and f, it correctly defines the range as a through c.

Can someone tell me the code for "Refers to" that will recognize
a
b
c
as the first range?

If the code were correct, would the definition of the second range be
=OFFSET(Sheet1!$A5,0,0,MATCH("*",Sheet1!$A5:$A$100 ,-1),1)

Thanks for any help.

Stephen Mehl




  #3  
Old August 20th, 2004, 04:59 AM
L Mehl
external usenet poster
 
Posts: n/a
Default

Lynn --

Thank you.

I was hoping for code to use in the range name definition. I will see about
incorporating this in the calculations.

Larry


"Lynn Arlington" wrote in message
...
I have used the xldown command as follows:

Range("A1").Select
ActiveCell.End(xlDown).Select
LastRow = ActiveCell.Row
Range("a1:e" & LastRow).Select

This selects to column e only the rows used when pressing CTRL+DOWN




"L Mehl" wrote:

Hello:

One worksheet will contain more than one table holding lookup values
(prices, CPU speed, etc.). They will be located one on top of another,

with
possibly some other data between tables, separated by at least one

blank
row. They will be expandable by row, as new prices, CPUs, etc. are

added.

I want the range name to expand and reflect all the rows in a table.

Using a column as an example of tables,

a (in A1)
b
c

d
e
f

represent 2 tables (ranges).

Excel Hacks has the code for Define Name "Refers to" as
=OFFSET(Sheet1!$A$1,0,0,MATCH("*",Sheet1!$A$1:$A$1 00,-1),1)

This formula does not see the blank between c and d as a separator of

two
ranges. It shows the range as a through f.

If I blank d, e, and f, it correctly defines the range as a through c.

Can someone tell me the code for "Refers to" that will recognize
a
b
c
as the first range?

If the code were correct, would the definition of the second range be
=OFFSET(Sheet1!$A5,0,0,MATCH("*",Sheet1!$A5:$A$100 ,-1),1)

Thanks for any help.

Stephen Mehl






  #4  
Old August 20th, 2004, 04:19 PM
Lynn Arlington
external usenet poster
 
Posts: n/a
Default

Check out this website

http://www.contextures.com/xlNames01.html

"L Mehl" wrote:

Lynn --

Thank you.

I was hoping for code to use in the range name definition. I will see about
incorporating this in the calculations.

Larry


"Lynn Arlington" wrote in message
...
I have used the xldown command as follows:

Range("A1").Select
ActiveCell.End(xlDown).Select
LastRow = ActiveCell.Row
Range("a1:e" & LastRow).Select

This selects to column e only the rows used when pressing CTRL+DOWN




"L Mehl" wrote:

Hello:

One worksheet will contain more than one table holding lookup values
(prices, CPU speed, etc.). They will be located one on top of another,

with
possibly some other data between tables, separated by at least one

blank
row. They will be expandable by row, as new prices, CPUs, etc. are

added.

I want the range name to expand and reflect all the rows in a table.

Using a column as an example of tables,

a (in A1)
b
c

d
e
f

represent 2 tables (ranges).

Excel Hacks has the code for Define Name "Refers to" as
=OFFSET(Sheet1!$A$1,0,0,MATCH("*",Sheet1!$A$1:$A$1 00,-1),1)

This formula does not see the blank between c and d as a separator of

two
ranges. It shows the range as a through f.

If I blank d, e, and f, it correctly defines the range as a through c.

Can someone tell me the code for "Refers to" that will recognize
a
b
c
as the first range?

If the code were correct, would the definition of the second range be
=OFFSET(Sheet1!$A5,0,0,MATCH("*",Sheet1!$A5:$A$100 ,-1),1)

Thanks for any help.

Stephen Mehl







  #5  
Old August 21st, 2004, 07:16 AM
L Mehl
external usenet poster
 
Posts: n/a
Default

Thanks Lynn.

I found some other useful techniques there, as well.

Larry


"Lynn Arlington" wrote in message
...
Check out this website

http://www.contextures.com/xlNames01.html

"L Mehl" wrote:

Lynn --

Thank you.

I was hoping for code to use in the range name definition. I will see

about
incorporating this in the calculations.

Larry


"Lynn Arlington" wrote in

message
...
I have used the xldown command as follows:

Range("A1").Select
ActiveCell.End(xlDown).Select
LastRow = ActiveCell.Row
Range("a1:e" & LastRow).Select

This selects to column e only the rows used when pressing CTRL+DOWN




"L Mehl" wrote:

Hello:

One worksheet will contain more than one table holding lookup values
(prices, CPU speed, etc.). They will be located one on top of

another,
with
possibly some other data between tables, separated by at least one

blank
row. They will be expandable by row, as new prices, CPUs, etc. are

added.

I want the range name to expand and reflect all the rows in a table.

Using a column as an example of tables,

a (in A1)
b
c

d
e
f

represent 2 tables (ranges).

Excel Hacks has the code for Define Name "Refers to" as
=OFFSET(Sheet1!$A$1,0,0,MATCH("*",Sheet1!$A$1:$A$1 00,-1),1)

This formula does not see the blank between c and d as a separator

of
two
ranges. It shows the range as a through f.

If I blank d, e, and f, it correctly defines the range as a through

c.

Can someone tell me the code for "Refers to" that will recognize
a
b
c
as the first range?

If the code were correct, would the definition of the second range

be
=OFFSET(Sheet1!$A5,0,0,MATCH("*",Sheet1!$A5:$A$100 ,-1),1)

Thanks for any help.

Stephen Mehl









  #6  
Old August 21st, 2004, 08:32 AM
icestationzbra
external usenet poster
 
Posts: n/a
Default

larry, correct me if i am wrong. even the formula given on the
contextures page will not ensure that the named range picks up value
only from contiguous regions. if it does, let me know, i would like to
use it too.

mac.


---
Message posted from http://www.ExcelForum.com/

  #7  
Old August 22nd, 2004, 08:59 PM
L Mehl
external usenet poster
 
Posts: n/a
Default

Mac --

I think you are correct. I have not built the model yet, but it looks like
I will have to have a different formula for each set of tables stacked
vertically,
where the cell name in which to start the next table's search for the last
row will be 2 greater than the number of the row containing the last record
in the table above (assuming the tables are separated by 1 blank row).

Does this help?

Larry


"icestationzbra " wrote in
message ...
larry, correct me if i am wrong. even the formula given on the
contextures page will not ensure that the named range picks up value
only from contiguous regions. if it does, let me know, i would like to
use it too.

mac.


---
Message posted from http://www.ExcelForum.com/



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting range in a column where data ends saziz General Discussion 7 July 28th, 2004 10:20 PM
Inserting multiple rows into a table while maintaining data? JAnderson General Discussion 2 July 8th, 2004 05:45 PM
Selecting Dynamic Data Range matt4003 General Discussion 2 June 20th, 2004 05:31 PM
Misconceived data range? Leslie Charts and Charting 0 April 30th, 2004 01:36 AM
Dynamic charts from data in a row x column dataset - advice please Takeshi Charts and Charting 1 March 16th, 2004 11:42 AM


All times are GMT +1. The time now is 09:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.