Sub 读取信息()
Application.ScreenUpdating = False
Dim ar As Variant
Dim i As Long
With Sheets("2115花名册")
r = .Cells(Rows.Count, 1).End(xlUp).Row
If r < 3 Then MsgBox "2115花名册工作表为空!": End
ar = .Range("a3:ak" & r)
End With
With Sheets("个人")
xm = .[b3]
For i = 2 To UBound(ar)
If Trim(ar(i, 2)) = Trim(xm) Then
For j = 1 To 11
.Cells(3, j) = ar(i, j)
Next j
.Cells(7, 1) = ar(i, 12)
.Cells(7, 7) = ar(i, 13)
.Cells(7, 8) = ar(i, 14)
.Cells(7, 10) = ar(i, 15)
For j = 16 To 18
.Cells(11, j - 15) = ar(i, j)
Next j
.Cells(11, 5) = ar(i, 19)
.Cells(11, 7) = ar(i, 20)
.Cells(11, 8) = ar(i, 21)
.Cells(11, 10) = ar(i, 22)
.Cells(11, 11) = ar(i, 23)
.Cells(15, 1) = ar(i, 24)
.Cells(15, 5) = ar(i, 25)
.Cells(15, 6) = ar(i, 26)
.Cells(15, 7) = ar(i, 27)
.Cells(15, 9) = ar(i, 28)
.Cells(15, 10) = ar(i, 29)
.Cells(15, 11) = ar(i, 30)
For j = 31 To 34
.Cells(19, j - 30) = ar(i, j)
Next j
.Cells(19, 8) = ar(i, 35)
For j = 36 To 37
.Cells(22, j - 35) = ar(i, j)
Next j
Exit For
End If
Next i
End With
MsgBox "ok!"
End Sub
|