ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   change the number of rows to a variable (https://www.excelbanter.com/excel-programming/337312-re-change-number-rows-variable.html)

theguz[_4_]

change the number of rows to a variable
 

You could create a macro that when activated gives you the number of
rows.

Dim i as integer

i = 0

Do until ActiveCell = ""
ActiveCell.Offset(1,0).Select
i = i +1
Loop

'At this point choose any cell that you want that value to be returned
to
'for example
Range("D1").Value = i

I hope that this helps.

theguz


--
theguz
------------------------------------------------------------------------
theguz's Profile: http://www.excelforum.com/member.php...o&userid=24918
View this thread: http://www.excelforum.com/showthread...hreadid=395920



All times are GMT +1. The time now is 02:25 AM.

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