ExcelVba 选区遍历

Sub 选区遍历()
useCols = Selection.Columns.Count
For Each c In Selection.Rows
a = 0
For i = 1 To useCols
If c.Cells(1, i).Interior.Color = RGB(255, 0, 0) Then
a = a + 1
End If
Next
c.Cells(1, i) = a
Next
End Sub
 

你可能感兴趣的:(ExcelVba)