@HighAndWilder
Okay, finally got back to this! I did as you instructed. I was able to choose the file that I wanted to import from but received a "Subscript out of range" message. Below is the code:
Public Sub subImportData()
Dim fd As Office.FileDialog
Dim strFile As String
Dim WbThisWorkbook As Workbook
Dim WbImportFrom As Workbook
ActiveWorkbook.Save
Application.ScreenUpdating = False
Set WbThisWorkbook = ThisWorkbook
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.Filters.Clear
.Filters.Add "Excel Files", "*.xlsx?", 1
.Filters.Add "Excel Files", "*.xlsm?", 1
.Title = "Choose an Excel file"
.AllowMultiSelect = False
.InitialFileName = ActiveWorkbook.Path
If .Show = True Then
strFile = .SelectedItems(1)
End If
End With
If strFile = "" Then
Application.ScreenUpdating = True
Exit Sub
End If
' Open the source workbook.
Workbooks.Open strFile, ReadOnly:=True
' Set an object to this workbook.
Set WbImportFrom = ActiveWorkbook
' LOOK AT THESE TWO LINES OF CODE.
' This line copies the value from range A1 in Sheet1 in the source workbook to
' range A1 in the destination workbook.
WbThisWorkbook.Sheets("Sheet1").Range("B1").Value = WbImportFrom.Sheets("Sheet1").Range("H7").Value
' You can just copy the above line of code and change it to, for example, take the value from range D16
' in the source workbook and copy it to range B13 in the destination workbook.
WbThisWorkbook.Sheets("Sheet1").Range("B2").Value = WbImportFrom.Sheets("Sheet1").Range("R5").Value
' This line copies the value from range A1 in Sheet1 in the source workbook to
' range A1 in the destination workbook.
WbThisWorkbook.Sheets("Sheet2").Range("C27").Value = WbImportFrom.Sheets("Sheet1").Range("E25").Value
' You can just copy the above line of code and change it to, for example, take the value from range D16
' in the source workbook and copy it to range B13 in the destination workbook.
WbThisWorkbook.Sheets("Sheet2").Range("C28").Value = WbImportFrom.Sheets("Sheet1").Range("E26").Value
' This line copies the value from range A1 in Sheet1 in the source workbook to
' range A1 in the destination workbook.
WbThisWorkbook.Sheets("Sheet2").Range("C29").Value = WbImportFrom.Sheets("Sheet1").Range("E27").Value
' You can just copy the above line of code and change it to, for example, take the value from range D16
' in the source workbook and copy it to range B13 in the destination workbook.
WbThisWorkbook.Sheets("Sheet1").Range("B7").Value = WbImportFrom.Sheets("Sheet1").Range("D32").Value
WbImportFrom.Close
Application.ScreenUpdating = True
ActiveWorkbook.Save
End Sub