Total of rows in UsedRange Area

  • Thread starter Thread starter me
  • Start date Start date
M

me

Hello All.

I have the following Code:

Option Explicit
Public Sub LastCell()
Dim X As Range
Set X = Range("A65536").End(xlUp).Offset(1, 0)
X.Select
X.Value = ????
End Sub

I need help getting the value of the number of rows in the usedrange area to
put in a cell that is in the row just under the last row.
Any suggestions?

Any help appreciated
 
Option Explicit
Public Sub LastCell()
Dim X As Range
Set X = Range("A65536").End(xlUp).Offset(1, 0)
X.Select
X.Value = x.row - 1
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top