Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default lastrow in formula

Hi everyone. I have a summary block on the top of a worksheet. Below
that is data, which is VBA populated and therefore every time the code
is run the amount of rows of data changes. How can I have a cell in
my Summary section do a direct cell reference on the last row? For
example, when I run the code, the last row of data is in row 45. So
the summary cell wold reference C45. If the last row was on 75, the
summary would reference C75. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default lastrow in formula

Hi

You don't tell us whether were looking for text or numeric so

Numeric
=ROW(INDEX(B:B,MATCH(9.99999999999999E+307,B:B)))
text
=ROW(INDEX(B:B,MATCH(REPT("z",10),B:B,1),1))

Both of which are arrays so commit with Ctrl+Shift+enter


Mike

"Steve" wrote:

Hi everyone. I have a summary block on the top of a worksheet. Below
that is data, which is VBA populated and therefore every time the code
is run the amount of rows of data changes. How can I have a cell in
my Summary section do a direct cell reference on the last row? For
example, when I run the code, the last row of data is in row 45. So
the summary cell wold reference C45. If the last row was on 75, the
summary would reference C75. Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default lastrow in formula

On Wed, 26 Mar 2008 13:50:33 -0700 (PDT), Steve
wrote:

Hi everyone. I have a summary block on the top of a worksheet. Below
that is data, which is VBA populated and therefore every time the code
is run the amount of rows of data changes. How can I have a cell in
my Summary section do a direct cell reference on the last row? For
example, when I run the code, the last row of data is in row 45. So
the summary cell wold reference C45. If the last row was on 75, the
summary would reference C75. Thanks!


Do you want the contents of the cell in the last row of data in column C?

If so, you could use this formula:

=LOOKUP(2,1/(LEN(C1:C65535)0),C1:C65535)

If you want something else, please be more specific about your data layout and
exactly what you want returned.
--ron
  #4   Report Post  
Posted to microsoft.public.excel.programming
ron ron is offline
external usenet poster
 
Posts: 118
Default lastrow in formula

On Mar 26, 2:50*pm, Steve wrote:
Hi everyone. *I have a summary block on the top of a worksheet. *Below
that is data, which is VBA populated and therefore every time the code
is run the amount of rows of data changes. *How can I have a cell in
my Summary section do a direct cell reference on the last row? *For
example, when I run the code, the last row of data is in row 45. *So
the summary cell wold reference C45. *If the last row was on 75, the
summary would reference C75. *Thanks!


It depends upon the structure and location of the summary block. If
only data exists in column C and it is contiguous, then something like

=INDIRECT(ADDRESS(COUNTA(C:C),3))

will work. The formula can be adjusted if the summary block also has
information in column C

=INDIRECT(ADDRESS(COUNTA(C10:C65536),3))

The key is that the VBA populated data must be contiguous for this
approach to be successful...ron
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
Lastrow Bishop Excel Worksheet Functions 2 May 13th 09 05:22 PM
Lastrow Mr. Damon[_2_] Excel Worksheet Functions 3 July 30th 08 04:12 PM
Using the Lastrow variable in a Count/Countif formula John[_80_] Excel Programming 2 April 17th 04 03:44 AM
Go to lastrow using other column's lastrow stakar[_14_] Excel Programming 5 April 16th 04 03:42 PM
Help with LastRow JStone0218 Excel Programming 4 December 4th 03 04:50 PM


All times are GMT +1. The time now is 09:57 AM.

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

About Us

"It's about Microsoft Excel"