spoo Posted April 29, 2019 Share Posted April 29, 2019 Hello guys, How to get the row which is highlighted in yellow color. that is row 44 and 49 Thanks in advance Link to comment Share on other sites More sharing options...
Nine Posted April 29, 2019 Share Posted April 29, 2019 Do you want to read the rows 44 and 49, or do you want to read the rows that are highlighted (whichever rows it could be) ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
water Posted April 29, 2019 Share Posted April 29, 2019 If you are looking for yellow cells then the answer is: No, the UDF does not support the needed FindFormat function. I check if you can filter on color and then just read the filtered lines. Another way is to use COM without the UDF as described here:https://docs.microsoft.com/en-us/office/vba/api/excel.cellformat My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted April 29, 2019 Share Posted April 29, 2019 This example works for me (for red cells): #include <Excel.au3> ; Create workbook with 3 rows and 3 columns. Set cells A1 and A3 to red Global $aUsedRow, $sMaxUsedColumn Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookNew($oExcel) Global $aValues = [[11, 21, 31], [12, 22, 32], [13, 23, 33]] _Excel_RangeWrite($oWorkbook, 1, $aValues) Global $iRed = 234 ; Hex 0xEA $oWorkbook.Activesheet.Range("A1").Interior.Color = $iRed $oWorkbook.Activesheet.Range("A3").Interior.Color = $iRed ; Get the max used range of the active sheet $sMaxUsedColumn = _Excel_ColumnToLetter($oWorkbook.ActiveSheet.Usedrange.Columns.Count) ; Loop through all rows and check column A for a red cell. If found, read all used cells of this row and display the array. For $i = 1 To $oWorkbook.ActiveSheet.Usedrange.Rows.Count If $oWorkbook.Activesheet.Range("A" & $i).Interior.Color = $iRed Then $aUsedRow = _Excel_RangeRead($oWorkbook, $oWorkbook.Activesheet, $oWorkbook.Activesheet.Range("A" & $i & ":" & $sMaxUsedColumn & $i)) _ArrayDisplay($ausedRow) EndIf Next My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
spoo Posted May 2, 2019 Author Share Posted May 2, 2019 @Nine I want to read rows which are highlighted . Link to comment Share on other sites More sharing options...
spoo Posted May 2, 2019 Author Share Posted May 2, 2019 (edited) @water Thanks for the reply, I will try and let you know if that worked Edited May 2, 2019 by spoo 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