We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Getting a cell name if that text exists in the worksheet


Can we use aspose to check if a particular value exists in that worksheet and get the cell name where it exists.
For example I want to check if ‘Apple’ text is present in the excel sheet and if it exists get the cell Number.

Appreciate your response.


Sure, you may try to use Find and replace feature provided by Aspose.Cells, see the document with example code for your reference. Also see the following sample code for your reference:
Sample code:

Workbook workbook = new Workbook(filePath);
Worksheet worksheet = workbook.Worksheets[0];
string searchValue = "Apple";

FindOptions options = new FindOptions();
options.LookInType = LookInType.Values;
options.LookAtType = LookAtType.Contains;
                Cell found = null;


                    found = worksheet.Cells.Find(searchValue, found, options);
                    if (found != null)
                        Debug.WriteLine("Cell: "  + found.Name + ", Value: " + found.StringValue);

                } while (found != null);

Hope, this helps a bit.

Yup. Thanks for the help!

You are welcome.