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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,224,525
Messages
6,179,319
Members
452,905
Latest member
deadwings

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