Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6732077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:36:21+00:00 2026-05-26T10:36:21+00:00

All, How can I find the last row in an excelsheet with data populated

  • 0

All,

How can I find the last row in an excelsheet with data populated in the cell. i.e.

   | C1  | C2  | C3  | C4 |
---------------------------
R1 |  1      2    3      4  
R2 |  5      6    7      8  
R3 |  
R4 |        9

So in the example above, I wish to retrieve the total count of rows as 4 since Row number 4 has something populated.

Is there any such library function available? Also, what is the best Java library for handling Microsoft Office document operations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:36:22+00:00Added an answer on May 26, 2026 at 10:36 am

    The most common Java library for dealing with Excel documents is Apache POI.

    http://poi.apache.org/

    They will have functions to iterate rows in Excel like what you need. Check out the examples, they are extremely straightforward.

    Once you get it working, use your HSSFSheet object and call: http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFSheet.html#getLastRowNum%28%29

    One you have the LastRowNum, then iterate through all the rows and then if the row contains a value, you want to say that it is the last row. If the only thing you need to do is fine the last row, you might want to start from the LastRowNum and work your way backwards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All I can find using fopen() and fwrite() in C is to delete all
Every place I have looked all I can find is how to read a
Does anybody know of a free flash obfuscator(protector)? All I can find are commercial
I've looked for overriding guidelines for structs, but all I can find is for
How I can find all extension methods in solution ?
How i can find all the windows created by a particular process using c#?
Hi all I can't find the error in this table creation bit, seems really
Is there some way I can find all active spies in sinon.js? I'd like
Is there a place where I can find all the keycodes for keys on
It seems that all of the documentation I can find about OpenGL-ES says something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.