Private Sub CommandButton1_Click ()
Dim Sh2 As Worksheet, myRng As Range, m % n %, i& , myC As New Collection
On the Error Resume Next
The Set Sh2=Sheet2
I=Sh2. [F65536]. End (xlUp). Row
Sh2. Range (F1: "O" & amp; I). Sort Key1:=Sh2 Range (F2), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _
:=xlPinYin
For n=2 To I
MyC. Add Sh2. Cells (n, "F"), CStr (Sh2. Cells (n, "F"))
Next
N=0
For n=1 To myC. Count
Sh2. Range (F1: "O" & amp; I). The AutoFilter Field:=1, Criteria1:=myC. Item (n)
M=Sh2. [F65536]. End (xlUp). Row
[K3]="" & amp; Sh2. Cells (m, "P")
[F3]="" & amp; Sh2. Cells (m, "G")
[I3]="" & amp; Sh2. Cells (m, "H")
[C3]="" & amp; Sh2. Cells (m, "I")
[C4]="" & amp; Sh2. Cells (m, "J")
[i2]="" & amp; Sh2. Cells (m, "Q")
[F4]="" & amp; Sh2. Cells (m, "R")
[A6: M10]=""
The Set myRng=Sh2. Range (" F2:0 "& amp; M) SpecialCells (xlCellTypeVisible)
MyRng. Copy (A6)
Sheet1. PrintOut
Next
Sh2. Range (S1: "O" & amp; I). The AutoFilter
End Sub
CodePudding user response:
Wish you a great god help to solve the problem that this is very simple, novice or a beginner, a little don't understand
CodePudding user response:
CodePudding user response: