Dynamic Range Issue

Nlreid

New Member
Joined
Jul 21, 2010
Messages
7
Hi,

I have a page at the beginning of my workbook that provides summary data on the rest of the 11 worksheets. For each of the 11 worksheets, I'd want to put the number of rows in the worksheet (# of rows minus 1 for the header would be even better). I'm running a macro that automatically updates the rows though, so I must use a dynamic range.

The 1st worksheet's name is "DF_PTYPESTYPE" and in the cell that I would like the row count to be placed I have the following formula:

=OFFSET(DF_PTYPESTYPE!$A$1,0,0,COUNTA($A:$A),1)

However, it is returning simply the data that is in cell A1 of the worksheet, rather than the count of rows in the worksheet.

How can I fix this formula?

Thanks so much!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi,

I have a page at the beginning of my workbook that provides summary data on the rest of the 11 worksheets. For each of the 11 worksheets, I'd want to put the number of rows in the worksheet (# of rows minus 1 for the header would be even better). I'm running a macro that automatically updates the rows though, so I must use a dynamic range.

The 1st worksheet's name is "DF_PTYPESTYPE" and in the cell that I would like the row count to be placed I have the following formula:

=OFFSET(DF_PTYPESTYPE!$A$1,0,0,COUNTA($A:$A),1)

However, it is returning simply the data that is in cell A1 of the worksheet, rather than the count of rows in the worksheet.

How can I fix this formula?

Thanks so much!
Maybe this:

=COUNTA(DF_PTYPESTYPE!$A$2:$A$65536)
 
Upvote 0
Hi,

I have a page at the beginning of my workbook that provides summary data on the rest of the 11 worksheets. For each of the 11 worksheets, I'd want to put the number of rows in the worksheet (# of rows minus 1 for the header would be even better). I'm running a macro that automatically updates the rows though, so I must use a dynamic range.

The 1st worksheet's name is "DF_PTYPESTYPE" and in the cell that I would like the row count to be placed I have the following formula:

=OFFSET(DF_PTYPESTYPE!$A$1,0,0,COUNTA($A:$A),1)

However, it is returning simply the data that is in cell A1 of the worksheet, rather than the count of rows in the worksheet.

How can I fix this formula?

Thanks so much!

If column A on DF_PTYPESTYPE is numeric, the following yields the last record:

=MATCH(9.99999999999999E+307,DF_PTYPESTYPE!$A:$A)

If you want the number of cells between DF_PTYPESTYPE!$A$1 and the cell of the last record...

=MATCH(9.99999999999999E+307,DF_PTYPESTYPE!$A:$A)-MIN(ROW(DF_PTYPESTYPE!$A$1))+1

If column A is text, replace the big number with:

REPT("z",255)

in the foregoing formulas.
 
Upvote 0

Forum statistics

Threads
1,216,070
Messages
6,128,613
Members
449,460
Latest member
jgharbawi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top