以下是一段使用 VBA 代码,它可以提取带有颜色的单元格的内容,并将其输出到第十三列:
Sub ExtractColoredCells()
Dim i As Long
Dim j As Long
Dim lastRow As Long
Dim lastCol As Long
Dim cellColor As Long
Dim targetCol As Long
targetCol = 13
lastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
lastC