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.
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:
e.g 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;
do
{
found = worksheet.Cells.Find(searchValue, found, options);
if (found != null)
{
Debug.WriteLine("Cell: " + found.Name + ", Value: " + found.StringValue);
}
} while (found != null);
..........