第1个回答 2013-04-15
Private Sub CommandButton1_Click()
a = Sheet1.UsedRange.Rows.Count
b = Sheet1.UsedRange.Columns.Count
For i = 10 To b
s = 2
For j = 4 To a
Sheet1.Cells(j, i).Select
If Selection.Interior.ColorIndex = 3 Then ‘ 留意颜色序号(3为红色)
s = s + 1
Sheet2.Cells(s, 3) = Sheet1.Cells(j, 1)
Sheet2.Cells(s, 4) = Sheet1.Cells(2, i)
Sheet2.Cells(s, 5) = "橙色"
End If
Next j
Next i
End Sub