Assign this macro to the dropdown control.
Change the folder path within the code of the master workbook files to suit.
The macro assumes the value in the drop down is the filename & .xlsx e.g.; Master workbook1.xlsx
Sub Copy_Master_WB_Data()
Dim strPath As String
Dim strFile As String
Dim DD As DropDown
strPath = "C:\Test\" 'Master workbook folder
Set DD = Sheets("Sheet1").DropDowns(Application.Caller)
If DD.ListIndex > -1 Then
strFile = strPath & DD.List(DD.ListIndex) & ".xlsx"
If Len(Dir$(strFile)) Then
Application.ScreenUpdating = False
If Range("A10") <> "" Then Range("A10", Cells.Find("*", , , , 1, 2)).EntireRow.ClearContents
With Workbooks.Open(strFile)
.Sheets(1).UsedRange.Copy
ThisWorkbook.Sheets("Sheet1").Range("A10").PasteSpecial xlPasteValuesAndNumberFormats
.Close SaveChanges:=False
End With
Range("A10").Select
Application.ScreenUpdating = True
Else
MsgBox strFile, vbExclamation, "File Not Found"
End If
End If
End Sub
Bookmarks