SeF Posted January 15, 2010 Share Posted January 15, 2010 (edited) Hello!I will try to explain what I want by giving an example.First, a sample code:HotKeySet("{F1}", "Start") While 1 sleep(100) WEnd Func Start() $oExcel = ObjGet("", "Excel.Application") $Positions = $oExcel.Application.Selection.Address MsgBox(0, "Example", $Positions) EndFuncSee this Excel sheet:If I select the cells like the picture and press "F1", the text on the MessageBox will be: $A$3:$A$7But, If I apply some Filters like these:The result will be the same: $A$3:$A$7End of story: I get the same result with or without Filters.I want to get every position from all the selected Cell (Actually, I need only the Rows...)For example : pressing "F1" and returning only A3, A5 and A7 when the Filter is ON.Thanks! Edited January 15, 2010 by SeF Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 15, 2010 Share Posted January 15, 2010 Try something like: #include <Excel.au3> Global Const $xlCellTypeVisible = 12 ; ... $oSelRange = $oExcel.ActiveSheet.AutoFilter.Range.SpecialCells($xlCellTypeVisible) Don't have Excel here to test. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
SeF Posted January 16, 2010 Author Share Posted January 16, 2010 (edited) Try something like: #include <Excel.au3> Global Const $xlCellTypeVisible = 12 ; ... $oSelRange = $oExcel.ActiveSheet.AutoFilter.Range.SpecialCells($xlCellTypeVisible) Don't have Excel here to test. Thanks for the reply! I did it! Just by changing a little bit your code: $Positions = $oExcel.Selection.SpecialCells($xlCellTypeVisible).Address Edited January 16, 2010 by SeF Link to comment Share on other sites More sharing options...
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