|
发表于 2017-9-28 17:17
来自手机
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Private Sub CommandButton1_Click()
Dim arr(), i%, g%, b%, d%
On Error Resume Next
Application.ScreenUpdating = False
With Sheet2
g = .Cells(Rows.Count, 3).End(xlUp).Row - 3
d = .Cells(1, Columns.Count).End(xlToLeft).Column - 3
.[D4:RM70500].ClearContents
ReDim arr(1 To g, 1 To d)
For b = 1 To d
For i = 1 To g
arr(i, b) = WorksheetFunction.HLookup(.Cells(1, b + 3), Sheet1.Range("A1:RM70500"), i + 1, False)
Next i
Next b
.[D4].Resize(g, d) = arr
End With
End Sub |
|