Hello All,
Is it posible to open 20+ workbook (wbs are stored in same folder and file name is difference such as xxx-xxxxxx-xx) and copy data in sheet1 of each wb then save into 1 worksheet of a master WB?
Regards,
tt3
Hello All,
Is it posible to open 20+ workbook (wbs are stored in same folder and file name is difference such as xxx-xxxxxx-xx) and copy data in sheet1 of each wb then save into 1 worksheet of a master WB?
Regards,
tt3
If they all are
1) The same kind of excel file
2) Same folder with no excess files in it
3) All have the same sheet names
4) The records are organised neatly
You can just write something like this
Dim sDir As String Dim sFname As String Dim sSheet As String Dim ws As Worksheet Set thswbk = ThisWorkbook Application.ScreenUpdating = False 'On Error GoTo exit_sub With Application.FileDialog(msoFileDialogFolderPicker) .AllowMultiSelect = False .Show sDir = .SelectedItems(1) End With sFname = Dir(sDir & "\*.xls") Set thswbk = ThisWorkbook Application.DisplayAlerts = False Do While sFname <> "" Workbooks.Open sDir & "\" & sFname, Format:=1, Local:=True Set actvbk = ActiveWorkbook actvbk.Activate [Do all your copying stuff and pasting here, if you need more help need the details] Workbooks(sFname).Close SaveChanges:=False sFname = Dir Loop
Last edited by poorcloud; 01-09-2013 at 02:47 AM.
Hello PoorCloud,
1) The same kind of excel file Yes
2) Same folder with no excess files in it Yes
3) All have the same sheet names Yes
4) The records are organised neatly Yes
_Variable not defind => Set thswbk = ThisWorkbook
_I was asking the folder and the Macro deleted by itselft after I enter the folder. (C:\Testing)
Can you take a look and help me out.
Regards,
tt3
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks