Why not replace this code,
wbTarget.Activate
wbTarget.Range("A1").Select
wbTarget.Range("A1:C10").ClearContents
wbThis.Activate
with this?
wbTarget.ActiveSheet.Range("A1:C10").ClearContents
And this,
wbThis.Activate
Application.CutCopyMode = False
wbThis.Range("A1:C10").Copy
wbTarget.Range("A1").PasteSpecial
with this.
wbThis.ActiveSheet.Range("A1:C10").Copy wbTarget.ActiveSheet.Range("A1")
Application.CutCopyMode = False
As for a dialog for selecting the file, you could use Application.GetOpenFilename.
Sub CopytoAnotherWorkbook()
Dim wbTarget As Workbook 'workbook where the data is to be pasted
Dim wbThis As Workbook 'workbook from where the data is to copied
Dim strName As String 'name of the source sheet/ target workbook
Dim strFileName As String
Set wbThis = ActiveWorkbook
strName = ActiveSheet.Name
ChDir "C:\Test\" ' change as needed
strFileName = Application.GetOpenFilename("Excel Files (*.xls*),*.xls*", , "Choose destination file", , False)
Set wbTarget = Workbooks.Open(strFileName)
Bookmarks