GirishDhruva
Active Member
- Joined
- Mar 26, 2019
- Messages
- 308
Hi Everyone ,
Can we browse and copy all the sheets to Master sheet.
Like if i browse for a "Abc" excel workbook, it should copy all the sheets that are available in "Abc" workbook and paste that in Master workbook
Can this be done any suggestion?????
Here is what i tried
But from the above code it searched for that sheet name , instead of that i need to copy all the sheets that are available
Thanks in advance
Can we browse and copy all the sheets to Master sheet.
Like if i browse for a "Abc" excel workbook, it should copy all the sheets that are available in "Abc" workbook and paste that in Master workbook
Can this be done any suggestion?????
Here is what i tried
Code:
Sub Browse_And_Add_Sheets()
Dim ws As Worksheet
Range("A2").Select
myfile = Application.GetOpenFilename(, , "Browse for Workbooks")
Workbooks.Open myfile
For Each ws In ActiveWorkbook.Worksheets
If ws.Name Like "Live Employees" Then
Sheets("Live Employees").Copy After:=Workbooks("Master").Sheets(1)
Sheets("Master").Select
ElseIf ws.Name Like "EsiReport" Then
Sheets("EsiReport").Copy After:=Workbooks("Master").Sheets(1)
Sheets("Master").Select
Next ws
Windows("Master.xlsm").Activate
End Sub
But from the above code it searched for that sheet name , instead of that i need to copy all the sheets that are available
Thanks in advance