Sub GetDatafromAnotherFile()
Dim strFileName As String
Dim wbOpened As Workbook, wbThis As Workbook
Dim rng As Range
Set wbThis = ThisWorkbook
strFileName = Application.GetOpenFilename("Excel Files (*.xls*), *.xls*")
If strFileName = "False" Then
MsgBox "No file selected!", vbExclamation
Exit Sub
Else
Set wbOpened = Workbooks.Open(strFileName)
Set rng = Application.InputBox("Please select the range to copy!", "SELECT RANGE", Type:=8)
If rng Is Nothing Then
MsgBox "No range selected!", vbExclamation
Exit Sub
Else
rng.Copy wbThis.Sheets(1).Range("A1")
End If
End If
Call CopyData
End Sub