|
Sub 提取数据()
Dim arr, brr(1 To 100, 1 To 200)
Dim wb As Workbook
Dim mypath$, myname$
Application.DisplayAlerts = False
Application.ScreenUpdating = False
mypath = ThisWorkbook.Path & "\数据\"
myname = Dir(mypath & "*.csv")
Do While myname <> ""
Set wb = GetObject(mypath & myname)
With wb
With .Worksheets(1)
r = .[a65536].End(3).Row
arr = .Range("g2:g" & r)
n = 0
k = k + 1
For i = 1 To UBound(arr)
n = n + 1
brr(n, k) = arr(i, 1)
Next
End With
.Close False
End With
myname = Dir()
Loop
With ThisWorkbook.Worksheets("数据导入")
.[b2].Resize(n, k) = brr
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "提取完成!", vbInformation
End Sub
Sub 清除()
With ThisWorkbook.Worksheets("数据导入")
.UsedRange.Offset(1).ClearContents
End With
End Sub
|
评分
-
1
查看全部评分
-
|