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/337313-change-number-rows-variable.html)

minrufeng[_6_]

change the number of rows to a variable
 

Now, the number of rows in 'Data' sheet is 3938, so the function is:
=SUMPRODUCT((Data!G2:G3938=7100)*(Data!B2:B3938=10 00)*(Data!O2:O3938=2)*(Data!C2:C3938)


If I don't know the number of rows is 3938, what should I do t
accomplish the same function

--
minrufen
-----------------------------------------------------------------------
minrufeng's Profile: http://www.excelforum.com/member.php...fo&userid=2620
View this thread: http://www.excelforum.com/showthread.php?threadid=39592


Raman325[_18_]

change the number of rows to a variable
 

Use:
ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastC ell).Row

This returns the number of the last used row in a worksheet


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


minrufeng[_7_]

change the number of rows to a variable
 

How to combine this into the sumproduct function in the original post?
Thanks for your help.

Raman325 Wrote:
Use:
ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastC ell).Row

This returns the number of the last used row in a worksheet



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



All times are GMT +1. The time now is 01:40 PM.

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