We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is there a way to find the last used cell?

Thread ID:





96088 Aug 19,2010 08:48 PM UTC Aug 20,2010 05:10 AM UTC ASP.NET Web Forms (Classic) 1
Tags: XlsIO
Mark Oudesluys
Asked On August 19, 2010 08:48 PM UTC


I am trying to find a simple way of finding the last column with data in it.

In Excel VBA, the command Worksheet(sheetname).SpecialCells(xlCellTypeLastCell) will get the last cell used in the worksheet. Is there an equivalent command in Syncfusion XlsIO?


Sathish Babu R [Syncfusion]
Replied On August 20, 2010 05:10 AM UTC

Hi Mark ,

Thank you for your interest in Syncfusion products.

In our XlsIO, It is possible to get the last cell in the used range with the below code snippet. Also we have attached sample for your reference. Could you please try the same and let us know if this helps you.

Code Snippet:

IRange usedRange = sheet.UsedRange;
IRange lastCell = usedRange[usedRange.LastRow, usedRange.LastColumn];
lastCell.Text = "Last cell";

Dim usedRange as IRange = sheet.UsedRange
Dim lastCell as IRange
lastCell = usedRange(usedRange.LastRow, usedRange.LastColumn)
lastCell.Text = "Last cell"


Please let us know if you have any queries.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon