Sub TEST1()
Dim xR As Range, xH As Range, xU As Range, j&
Sheets("工作表1").UsedRange.Clear
Set xH = [工作表1!A2]
[嘉義!A1].Copy xH(0)
For Each xR In Range([嘉義!A2], [嘉義!A65536].End(xlUp))
If xR.Row = 1 Then Exit Sub
If xR = "" Then GoTo 101
Set xU = xR.Resize(6, 2)
For j = [C1].Column To [Z1].Column
If xR(1, j) >= 36 Then Set xU = Union(xU, xR(1, j).Resize(6))
Next j
xU.Copy xH
Set xH = xH(8)
101: Next
End Sub 作者: yen956 時間: 2015-12-22 16:04
試試看:
Private Sub CommandButton1_Click()
Dim sh1 As Worksheet
Dim c0 As Long, r0 As Long, LstR0 As Long, cnt As Integer
Dim c1 As Long, r1 As Long, LstR1 As Long, msg As Integer