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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

What is the way to locate cells that contain formula/links/strings/Number using XLSIO?

Platform: WinForms |
Control: XlsIO

XlsIO has the following API''s to locate the cells that contain the formula, links,strings and Number.

  • HasFormula: Returns the cell that contains formula.
  • HasStyle: Returns the cell that contains Hyperlink.
  • HasString: Returns the cell that has the string value.
  • HasNumber: Returns the cell that has the numeric value.


for (int i = 0; i < sheet.UsedRange.Rows.Length; i++)
 for (int j = 0; j < sheet.UsedRange.Columns.Length; j++)
  IRange cell = sheet.Range[i + 1, j + 1];
  if (cell.HasFormula == true)
   MessageBox.Show(cell.AddressLocal + "" + cell.Formula.ToString());



For i As Integer = 0 To sheet.UsedRange.Rows.Length - 1
 For j As Integer = 0 To sheet.UsedRange.Columns.Length - 1
            Dim cell As IRange = sheet.Range(i + 1, j + 1)
                      If cell.HasFormula = True Then
                         MessageBox.Show(cell.AddressLocal + cell.Formula.ToString())
                     End If
 Next j
Next i


Here is the sample for your reference:



2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile