|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub aaasf()
Dim a As Integer, b As Integer
a = 1
b = 8
Range(Cells(a + 1, 1), Cells(65536, b)).ClearContents
Application.ScreenUpdating = False
Dim c As String, d As Integer, e As Workbook, f As Worksheet, g As Variant, h As String
c = Dir(ThisWorkbook.Path & "\*.csv")
Do While c <> ""
If c <> ThisWorkbook.Name Then
d = [a1].CurrentRegion.Rows.Count - 1
h = ThisWorkbook.Path & "\" & c
Set e = GetObject(h)
Set f = e.Sheet1
g = f.Range(f.Cells(a + 1, 1), f.Cells(65536, b).End(xlUp))
Cells(d, 1).Resize(UBound(g, 1), UBound(g, 2)) = g
e.Close False
End If
c = Dir
Loop
Application.ScreenUpdating = True
End Sub
这个是针对excel表的,但是用csv的时候就不行了 请大神指点
|
|