写了一段代码,看看是不是你所要的。
Sub xrs()
Application.ScreenUpdating = False
Range("C3:J" & [B65536].End(xlUp).Row).ClearContents
Dim Sh As Worksheet
For Each c In Range("A3:A" & [B65536].End(xlUp).Row)
If c <> "" Then
h = c.Value
x = c.Row
For Each Sh In Worksheets
If Sh.Name = h Then
Cells(x, 3) = Sh.Cells(4, 3)
Cells(x + 1, 3) = Sh.Cells(5, 3)
Cells(x, 4) = Sh.Cells(4, 4)
Cells(x + 1, 4) = Sh.Cells(5, 4)
Cells(x, 5) = Sh.Cells(4, 5)
Cells(x + 1, 5) = Sh.Cells(5, 5)
Cells(x, 6) = Sh.Cells(4, 6)
Cells(x + 1, 6) = Sh.Cells(5, 6)
Cells(x, 7) = Sh.Cells(4, 7)
Cells(x + 1, 7) = Sh.Cells(5, 7)
Cells(x, 8) = Sh.Cells(8, 1)
Cells(x, 9) = Sh.Cells(8, 5)
Cells(x, 10) = Sh.Cells(8, 6)
End If
Next
End If
Next c
Application.ScreenUpdating = True
End Sub