Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Deleting rows out of excel through _ExcelReadSheetToArray

$
0
0
Admittedly, I have not done much with the Excel UDF, though what little I have used it has always worked flawlessly. The issue I am encountering below I am pretty sure is more due to the way I am handling the array rather than Excel, but would appreciate any suggestions.

I am reading the necessary rows and colums from a spreadsheet (attached) into an array. I am then cycling through the array to delete rows if they meet certain criteria. I am currently using Ubound, but don't believe I am doing so correctly as the script fails to grab all the rows that match the criteria. I have always stayed away from ReDim, but is this a case where I would have to use it?

[ autoit ]      
#include <Array.au3> #include <Excel.au3> $oExcel = _ExcelBookOpen(@DesktopDir & "\ACC.xls", 1) Local $aArray = _ExcelReadSheetToArray($oExcel, 1, 1, 0, 3) For $i = 1 To UBound($aArray) -1 Select Case StringInStr($aArray[$i][2], "Citrix")     _ExcelRowDelete($oExcel, $i) Case StringInStr($aArray[$i][2], "Microsoft")     _ExcelRowDelete($oExcel, $i) EndSelect Next

Attached Files

  • Attached File  ACC.xls   31K   7 downloads

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>