Thanks for the edits. So I'm not sure if I'm doing this right now, but am getting the below Debug message:
Set sh = ThisWorkbook.Worksheets("MasterData")
So, I open the MasterData excel file where I need the data imported in. These are the steps I am following after opening the file.
Alt F11; right-click on Sheet1 (under VBAProject (MasterData); Insert; Module. Then paste your code; Ctrl S; select No, and Save as Macro-Enabled File; Then Alt X to close VBA. Then I Run the Macro and the above underlined error pops up.
VBA code I am using is below (given by you):
Bookmarks