ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Real Value of .UsedRange.Rows.Count (https://www.excelbanter.com/excel-worksheet-functions/42212-real-value-usedrange-rows-count.html)

dazman

Real Value of .UsedRange.Rows.Count
 

Hi,

In VBA I'm setting a variable as follows:
NumRows = Sheets("Summary").UsedRange.Rows.Count

and NumRows is subsequently used to make sure a chart has the correct
last row after an update that changes the number of used rows in my
worksheet.

The problem is that my worksheet contains 80 rows of real data. However
there once existed 600 rows. Would be grateful if anyone knows how I
can get Excel to forget about what once existed and only concentrate on
cells that now have a value in them?


--
dazman
------------------------------------------------------------------------
dazman's Profile: http://www.excelforum.com/member.php...o&userid=25903
View this thread: http://www.excelforum.com/showthread...hreadid=398856


Rowan

There is some code here to reset the usedrange.

http://www.contextures.on.ca/xlfaqApp.html#Unused

Hope this helps
Rowan

"dazman" wrote:


Hi,

In VBA I'm setting a variable as follows:
NumRows = Sheets("Summary").UsedRange.Rows.Count

and NumRows is subsequently used to make sure a chart has the correct
last row after an update that changes the number of used rows in my
worksheet.

The problem is that my worksheet contains 80 rows of real data. However
there once existed 600 rows. Would be grateful if anyone knows how I
can get Excel to forget about what once existed and only concentrate on
cells that now have a value in them?


--
dazman
------------------------------------------------------------------------
dazman's Profile: http://www.excelforum.com/member.php...o&userid=25903
View this thread: http://www.excelforum.com/showthread...hreadid=398856



dazman


Very useful info


--
dazman
------------------------------------------------------------------------
dazman's Profile: http://www.excelforum.com/member.php...o&userid=25903
View this thread: http://www.excelforum.com/showthread...hreadid=398856



All times are GMT +1. The time now is 04:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com