Count Last Row with data in Range

ionelz

Board Regular
Joined
Jan 14, 2018
Messages
248
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have this Range C2:Y1000 and there are empty cells
I need to Count from C2 down which is the last row with data in any cells
I can not use counta(c2:c1000) because may may get 10 but for example caunta(n2:n1000)=25
I need the MAX so column with MAX of counta, that will tell the ROWS with data
Thanks all
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
How about:

VBA Code:
       LastRowInRange = Range("C2:Y1000").Find("*", , xlFormulas, , xlByRows, xlPrevious).Row             ' Returns a Row Number
 
Upvote 0
could you please write a formula for this ? not vba
 
Upvote 0
How about:

=SUMPRODUCT(MAX((C2:Y1000<>"")*ROW(C2:Y1000)))
 
Upvote 0
How about:

VBA Code:
       LastRowInRange = Range("C2:Y1000").Find("*", , xlFormulas, , xlByRows, xlPrevious).Row             ' Returns a Row Number
How can I say that A1= value from vba above ? (I want to put the result in A1)
 
Upvote 0
How can I say that A1= value from vba above ? (I want to put the result in A1)
VBA Code:
      LastRowInRange = Range("C2:Y1000").Find("*", , xlFormulas, , xlByRows, xlPrevious).Row             ' Returns a Row Number
      Range("A1").Value = LastRowInRange
or more simply:
VBA Code:
      Range("A1").Value = Range("C2:Y1000").Find("*", , xlFormulas, , xlByRows, xlPrevious).Row
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,323
Members
449,077
Latest member
jmsotelo

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