Hi
Code:Sub kTest() Dim SourceFile As String Dim Dest As Range Dim wbkSource As Workbook Dim SourceRange As Range Dim SourceData With Application.FileDialog(msoFileDialogFilePicker) .Filters.Clear .AllowMultiSelect = False If .Show = -1 Then SourceFile = .SelectedItems(1) End If End With If Len(SourceFile) Then Set wbkSource = Workbooks.Open(SourceFile) Set SourceRange = Application.InputBox("Select the source range", "Destination", "A2", Type:=8) SourceData = SourceRange.Value2 wbkSource.Close 0 Set wbkSource = Nothing Set Dest = Application.InputBox("Select the destination range", "Destination", "A2", Type:=8) Dest.Cells(1).Resize(UBound(SourceData, 1), UBound(SourceData, 2)) = SourceData End If End Sub




Reply With Quote
Bookmarks