How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Jason Jones Your Own Question

Jason Jones
Jason Jones, Programmer
Category: Programming
Satisfied Customers: 14038
Experience:  Over 10 years of work experience.
Type Your Programming Question Here...
Jason Jones is online now
A new question is answered every 9 seconds

I'm need to get the exact last row in a lot of spreadsheets

Customer Question

I'm need to get the exact last row in a lot of spreadsheets usedrange.rows.count gives me the wrong number
Works better if I take the max of multiple columns
But have problems if the workbook has a warning message that comes out in the beginning i.e. Circular reference etc I get a default value of one
What is the best way to do this.
FYI. Also have hidden sheets
Submitted: 1 month ago.
Category: Programming
Expert:  Pete replied 1 month ago.

Hi Bill,
My name is***** will try my best to help you with your question.

You should always avoid using usedrange to count rows.

Instead, you can find the last row and use that instead.

To find the last row in column A, you can use:

With Sheets("Sheet1")

LastRow = .Range("E" & .Rows.Count).End(xlUp).Row

End With

Kindly rate my service 5 stars at the top of your question page if my answer helped so I am rewarded for my time; tips appreciated :)
You can always reply back at any time if you need further assistance.

Customer: replied 1 month ago.
Already tried that and I does work great 99 percent of the time but if I am activating a sheet that has a warning culircular ref it does not work how can I get those messages to not stop me
Expert:  Jason Jones replied 1 month ago.

I am the person that will be helping you today. Please, send me a document where you can show me the problem in action.

Please, be forewarned that the site is not secure:
- Click the following link:
- Upload the file to that website
- Once it is uploaded, the resulting page will display a "File ID" number.
- Please, give me that "File ID Number"
Please, send your reply below in the box. After you type your message, click the Send button.

Thank you,