Hi Guys,
I have an issue with this vba coding. So the purpose of this file is to import data from a folder of similar excel files (meaning all the excel files have the same structures and format but different values for the input data & different file name) into a single excel file. I managed to source around this code but however when I ran it, nothing happens. Is there anything that I had input wrongly to the code or?
Here's the code
Sub importall()
Dim my_Path As String
Dim File_Name As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
my_Path = "H:" 'location of the folder'
File_Name = Dir(my_Path & "*.xlsm")
Do While Len(File_Name) <> 0
Workbooks.Open (my_Path & "*.xlsm")
'Rest over here are the copying data from "opened" worksheet to the current worksheet'
Workbooks(Workbooks.Count).Close Savechanges:=False
File_Name = Dir()
Loop
End Sub
Thank you so much guys!!
I have an issue with this vba coding. So the purpose of this file is to import data from a folder of similar excel files (meaning all the excel files have the same structures and format but different values for the input data & different file name) into a single excel file. I managed to source around this code but however when I ran it, nothing happens. Is there anything that I had input wrongly to the code or?
Here's the code
Sub importall()
Dim my_Path As String
Dim File_Name As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
my_Path = "H:" 'location of the folder'
File_Name = Dir(my_Path & "*.xlsm")
Do While Len(File_Name) <> 0
Workbooks.Open (my_Path & "*.xlsm")
'Rest over here are the copying data from "opened" worksheet to the current worksheet'
Workbooks(Workbooks.Count).Close Savechanges:=False
File_Name = Dir()
Loop
End Sub
Thank you so much guys!!