|
参与一下。。。
- Sub ykcbf() '//2024.3.20
- Application.ScreenUpdating = False
- With Sheets("Sheet2")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c)
- ReDim brr(1 To UBound(arr), 1 To 7)
- For j = 1 To UBound(arr, 2) Step 6
- For i = 1 To UBound(arr)
- If .Cells(i, j).Interior.ColorIndex = 8 And .Cells(i, j + 1).Interior.ColorIndex = 8 Then
- m = m + 1
- brr(m, 1) = arr(i, j)
- brr(m, 2) = arr(i, j + 1)
- brr(m, 4) = arr(i, j + 3)
- brr(m, 5) = arr(i, j + 4)
- brr(m, 6) = i
- brr(m, 7) = j
- End If
- Next
- Next
- End With
- With Sheets("Sheet1")
- If m > 0 Then
- .[w:ac] = ""
- .[w1].Resize(m, 7) = brr
- End If
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
3
查看全部评分
-
|