Home > OS >  Get colour highlighted cells from excel
Get colour highlighted cells from excel

Time:09-22

I got an excel sheet with randomly placed yellow highlighted cells. In these cells, there are keywords that I need to use. It is possible to copy all these cells to a row ? I found that it is possible to search for cells with find all but the output cannot be copied.

CodePudding user response:

If you can do it via a Find command, then you can record that into a macro and, if needed, modify it to your wishes, e.g.:

enter image description here

Recording this command results in following VBA macro:

With Application.FindFormat.Interior
    .PatternColorIndex = xlAutomatic
    .Color = 65535
    .TintAndShade = 0
    .PatternTintAndShade = 0
End With
Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas2, LookAt:= _
    xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
    , SearchFormat:=True).Activate
  • Related