|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Option Explicit
Sub TEST1()
Dim ar, i&, j&, r&
With Worksheets(1).[A1].CurrentRegion
ar = .Value: r = 1
For i = 2 To UBound(ar)
If .Rows(i).Interior.Color = vbYellow Then
r = r + 1
For j = 1 To UBound(ar, 2)
ar(r, j) = ar(i, j)
Next j
End If
Next i
End With
If r > 1 Then
With Worksheets(2)
.Cells.Clear
With .[A1].Resize(r, UBound(ar, 2))
.Columns(1).NumberFormatLocal = "m月d日"
.Value = ar
End With
.Activate
End With
End If
Beep
End Sub
|
|