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...
KennyK360
Jul 21, 2023Copper Contributor
Thank you so much for your help Sergei.
SergeiBaklan
Jul 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++
} )
}- SergeiBaklanJul 25, 2023Diamond Contributor
KennyK360 , glad to help
- KennyK360Jul 25, 2023Copper ContributorYes, that is perfect ! Thank you so much for all the help Sergei !!
- SergeiBaklanJul 25, 2023Diamond Contributor
Not sure I understood what is required. Do you mean something like
=LET( Num, C1, All, {53,71}, Factors, FILTER(All, MOD(Num, All) = 0), IFERROR( TRANSPOSE(Factors), "" ) )?
- KennyK360Jul 24, 2023Copper ContributorSergei, unfortunately I don't have the license to use ExcelScripts...I'll work on that.
Do you know what changes I can make to this formula so it only shows numbers 53 and 71 instead of numbers 21-1500?
=LET(Num,C1,All,SEQUENCE(MIN(Num-21,1479), , 21),Factors,FILTER(All,MOD(Num,All)=0),TRANSPOSE(Factors))
Thanks!