I have the following macro below to open several files and copy data
The data is not being copied
It would be appreciated if someone can kindly check & amend my code
Sub Open_Workbook()
Clear_Data
A:
Dim A As Variant
Dim LR As Long
Dim file As Variant
Dim FileAry As Variant, Fle As Variant
With Application.FileDialog(3)
.InitialFileName = "C:\Sales\"
.AllowMultiSelect = True
.InitialFileName = "C:\Sales\*BIGGS*.csv*"
If .Show Then Set FileAry = .SelectedItems()
End With
'For Each file In FileAry
If TypeName(A) = "Boolean" Then Exit Sub
Application.ScreenUpdating = False
With Sheets(1)
.Range("a1", .Range("Z" & Rows.Count).End(xlUp)).Copy _
Destination:=ThisWorkbook.Sheets(1).Range("A" & Rows.Count).End(xlUp).Offset(1)
End With
Application.ScreenUpdating = True
End Sub
Sub Clear_Data()
Dim LR As Long
With Sheets(1)
LR = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("A1:Z" & LR).ClearContents
End With
End Sub
Have posted a similar post on https://www.mrexcel.com/board/thread...files.1148019/
Bookmarks