Clerythecleric Posted August 4, 2017 Posted August 4, 2017 (edited) First time using the excel UDF, I have managed to write a simple script that just simply applys 2 filters and then sorts them in order. I need to copy the results after the filter is set to a new sheet. I did manage to pull somthing together but that copied the entire document over and i just need the ones applied after the filter. Or alternatively just delete all the rows that are not picked up in the filter. I tried messing with " _Excel_RangeCopyPaste " and _Excel_RangeDelete but i just can't seem to get the hang of it. IF anyone could be kind enough to push me in the right direction I would really appreciate it! Thanks This is what i have so far, i know its basic but it does exactly what i needed it to. #include <Excel.au3> #include <Array.au3> HotKeySet("{ESC}", "On_Exit") HotKeySet("{F1}", "FilterSheet") HotKeySet("{F2}", "test") global $workbook = _Excel_BookAttach("Book1") if @error Then MsgBox("", "Error", "Could not attach") Else MsgBox("", "Attached", "Attached Successfully") EndIf while 1 Sleep(50) WEnd func FilterSheet() _Excel_FilterSet($workbook, Default, Default, 12, "<0") _Excel_FilterSet($workbook, Default, Default, 4, ">1") _Excel_RangeSort($workbook, Default, Default, "L:L", Default, Default, $xlYes) EndFunc func test() $aResult = _Excel_RangeFind($workbook, "<1") EndFunc func On_Exit() Exit EndFunc Edited August 4, 2017 by Clerythecleric
water Posted August 4, 2017 Posted August 4, 2017 An example can be found in the wiki. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now