Forum Discussion
KennyK360
Jul 17, 2023Copper Contributor
Searching multiple worksheets for different numbers simultaneously in Excel
Is it possible to search multiple worksheets for different numbers simultaneously in Excel? Using CTL-F isn't working for me. For example, can I search 10 different worksheets all at once for t...
SergeiBaklan
Jul 19, 2023Diamond Contributor
Looks like totally different task. Other words, delete in the range entire rows which have cells with error in one or more columns, correct?
But that can't be done with formula, VBA or ExcelScript.
KennyK360
Jul 19, 2023Copper Contributor
Yes, that is correct (delete in the range entire rows which have cells with error in one or more columns). It can't be done with formula, VBA or ExcelScript...are you saying there are no options to achieve this task in Excel? Thank you for your time.
- SergeiBaklanJul 20, 2023Diamond Contributor
IMHO, that could be done with VBA or ExcelScript. I'll try bit later the latest.
- KennyK360Jul 21, 2023Copper ContributorThank you so much for your help Sergei.
- SergeiBaklanJul 22, 2023Diamond Contributor
That could be like
function main(workbook: ExcelScript.Workbook) { const range = workbook .getActiveWorksheet() .getUsedRange() const nRows = range .getRowCount() let j = 0; let nErrors: number[] = []; for( let i = 0; i < nRows; i++) { if ( range .getRow(i) .getValueTypes() .toString() .includes("Error") ) nErrors.push(i) } nErrors.map( x => { range .getRow(x - j) .getEntireRow() .delete(ExcelScript.DeleteShiftDirection.up); j++ } ) }