|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
不確定你的版本可不可用!
- Sub TEST()
- Dim R&, N%, M&, C%, Cn%, Rn%, i&, j&
- Call ClearAll
- Cn = [AH2]: Rn = [AH3]
- R = [L65536].End(3).Row
- Application.ScreenUpdating = False
- For i = 1 To 20
- For j = 1 To R + 1
- On Error Resume Next
- C = [L1].Cells(j, i - Cn).Resize(1, Cn).Interior.ColorIndex
- On Error GoTo 0
- If C <> xlNone Or j > R Then
- If N >= Rn Then [L1].Cells(M, i).Resize(N).Copy [AK1].Cells(M, i)
- N = 0: GoTo 101
- End If
- N = N + 1: C = 1: If N = 1 Then M = j
- 101: Next j
- Next i
- End Sub
- Sub ClearAll()
- With [AK:BD]: .ClearContents: .Interior.ColorIndex = xlNone: End With
- End Sub
复制代码
Xl0000330.rar
(56.24 KB, 下载次数: 2)
|
|