Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
How to find and replace a value in the excel sheet? (Excel Library)
posted

The workbook or worksheet has some "search" or "find" method?

I need to search for a value in a sheet or a book.

Parents
No Data
Reply
  • 1080
    Offline posted

    Hello,

    Thank you for posting in our community.

    I have been investigating the "search" or "find" behaviors you are looking for in the Infragistics Excel Library and I determined that currently, there is no built-in way to automatically do a find. However, you can achieve this by looping through the rows elements in the worksheet.rows() class, and then the cell elements in the worksheet.rows().cells() class. A sample loop for this would look like the following:

    const rowsCount = worksheet.rows().count;
    for (let i = 1; i < rowsCount; i++) {
    	const row = worksheet.rows(i);
    	const cellsCount = row.cells().count;
    	for (let j = 0; j < cellsCount; j++) {
    		const cell = row.cells(j).value;
    	}
    }

    There you can check the value of each of the cell elements and whether it contains the content that you are looking for.

    Please let me know if you need any further assistance with this matter.

Children
No Data