|
先选好打印机再运行,表2没有改你的函数。
Sub a()
With CreateObject("scripting.dictionary")
For i = 2 To Sheets("收样登记").Range("D" & Rows.Count).End(xlUp).Row
.Item(Sheets("收样登记").Cells(i, 4).Value) = Sheets("收样登记").Range(Sheets("收样登记").Cells(i, 5), Sheets("收样登记").Cells(i, 9)).Value
Next i
For P = 0 To .Count - 1
Cells(10, 1) = .keys()(P)
ActiveSheet.PrintOut
Next P
End With
End Sub
|
|