|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
On Error Resume Next
Dim ws As Worksheet, arr, wj As String
Application.ScreenUpdating = False
Set ws = ThisWorkbook.Sheets(2)
ws.Cells.ClearContents
wj = Dir(ThisWorkbook.Path & "\")
x = Val(InputBox("输入行号,行号大于等于4:"))
If x < 4 Then Exit Sub
Workbooks.Open Filename:=ThisWorkbook.Path & "\" & wj
Sheets(1).Activate
arr = Range(Cells(x, 1), Cells(x + 99, "o"))
ws.Range("a4").Resize(UBound(arr), UBound(arr, 2)) = arr
Workbooks(wj).Close
Application.ScreenUpdating = True |
|