I have the following macro below to select multiple files and to copy the data
It would be appreciated if someone could kindly amend my code so that if A2 is blank, then the data on those workbooks are not copied. Those where A2 is not Blank are to be copied
It would be appreciated if someone could kindly amend my code so that if A2 is blank, then the data on those workbooks are not copied. Those where A2 is not Blank are to be copied
Code:
Sub Open_MultipleFiles()
ChDir "C:\downloads"
A:
Dim A As Variant
Dim LR As Long
A = Application.GetOpenFilename(MultiSelect:=True)
If TypeName(A) = "Boolean" Then Exit Sub
Dim File As Variant
Application.ScreenUpdating = False
For Each File In A
With Workbooks.Open(File)
With Sheets(3)
.Range("a1", .Range("Q" & Rows.Count).End(xlUp)).Copy _
Destination:=ThisWorkbook.Sheets("Import").Range("A" & Rows.Count).End(xlUp)
' .Range("a1:M" & Rows.Count).End(xlUp).UnMerge
End With
.Close savechanges:=False
End With
Next
Application.ScreenUpdating = True
End Sub