Sub test()
Dim Arr, T, T1, i&, j&
T = Sheets("AA").Range("c1")
With Sheets("QQ")
Arr = .Range("a1:n" & .[b65536].End(3).Row)
For i = 1 To UBound(Arr) Step 9
For j = 2 To UBound(Arr, 2) Step 8
T1 = Arr(i, j): If T1 = "" Then GoTo 99
If T1 = T Then
.Cells(i, j).Offset(1).Resize(4, 5).Copy Sheets("AA").[c2]
Exit Sub
End If
99: Next
Next
End With
End Sub作者: ML089 時間: 2021-7-21 10:09
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$1" Then
Set xQ = Sheets("QQ").Cells.Find(AA.[C1], LookIn:=xlValues, LookAt:=xlWhole)
xQ(2, 1).Resize(8, 8).Copy Sheets("AA").[c2]
End If
End Sub作者: zz0660 時間: 2021-7-21 23:24
Sub T1()
Dim Arr, T, T1, i&, j&
T = Sheets("AA").Range("c1")
With Sheets("QQ")
Arr = .Range("a1:h" & .[b65536].End(3).Row) 'T1 T1,T2,T3請自行選擇更換
'Arr = .Range("j1:q" & .[k65536].End(3).Row) 'T2
'Arr = .Range("s1:z" & .[t65536].End(3).Row) 'T3
For i = 1 To UBound(Arr) Step 19
T1 = Arr(i, 2): If T1 = "" Then GoTo 99
If T1 = T Then
Sheets("AA").[B3].Resize(16, 8).Value = .Cells(i, 1).Offset(1).Resize(16, 8).Value
Exit Sub
End If
99: Next
End With
End Sub作者: zz0660 時間: 2021-7-23 12:02