Trouver la valeur dans Cells

Aspose.Cells - Trouver la valeur dans Cells

Dans Microsoft Excel, les utilisateurs peuvent rechercher des cellules contenant des données spécifiques. Par exemple, en cliquantÉditeret puisTrouverouvre la boîte de dialogue Rechercher. Les utilisateurs entrent une valeur et cliquentD’ACCORDpour le chercher. Excel met en évidence les champs correspondants.

C#

 //Instantiating a Workbook object

Workbook workbook = new Workbook("../../data/test.xlsx");

//Accessing the first worksheet in the Excel file

Worksheet worksheet = workbook.Worksheets[0];

//Finding the cell containing the specified formula

Cells cells = worksheet.Cells;

//Instantiate FindOptions

FindOptions findOptions = new FindOptions();

//Finding the cell containing a string value that starts with "Or"

findOptions.LookAtType = LookAtType.StartWith;

Cell cell = cells.Find("SH", null, findOptions);

//Printing the name of the cell found after searching worksheet

Console.WriteLine("Name of the cell containing String: " + cell.Name);

Télécharger le code d’exécution

TéléchargerTrouver la valeur dans Cells forment l’un des sites de codage social mentionnés ci-dessous :