Skip to main content
Question

To get last row of the excel

  • January 18, 2022
  • 4 replies
  • 1134 views

I am connecting Excel as database and want to get last not null row of a column in a table​

4 replies

Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+18
  • Most Valuable Pathfinder
  • January 18, 2022

Could you please below Query and use the loop to get the last value.

 

SELECT TOP 1 * FROM Table ORDER BY ID DESC

 


  • Author
  • Cadet | Tier 2
  • January 18, 2022

But this query is not giving me last row item...it gives some random values from the co​lumn.


  • Navigator | Tier 3
  • January 18, 2022

In stead of using Excel as database, you could use Excel function to go to A1, then go to the end of the column A, to reach the last row of the column in a table.


  • Cadet | Tier 2
  • January 18, 2022

Excel Advanced: Open

Excel Advanced: Go to cell (selecting End of the column)

Excel Advanced: Get cell adress of active cell

 

That gives you the cell adress of the last not null row.

Just remove the letter from the cell adress, and you will have the row number