I adapted this from something I already have.
It might be a bit long winded but it should work.
Sub Import_Worth_Issues()
Dim varFileFilter As Variant ''file command
Dim intFilterIndex As Integer ''file command
Dim strTitle As String ''file command
Dim c ''variant for file name command
Dim strThisWB As String
Dim strIssuesWB As String
On Error Resume Next
''turn off the screen warnings
Application.DisplayAlerts = False
''set the directory to the current path
ChDir (ActiveWorkbook.Path)
''get this workbook name for the returning call
strThisWB = ActiveWorkbook.Name
''set up the file open command
varFileFilter = "XL* (*.XL*), *.XL*"
intFilterIndex = 1
strTitle = "Please Select The Worth XLS File"
c = Application.GetOpenFilename(varFileFilter, intFilterIndex, strTitle)
''check if the user has selected a workbook
If c <> "False" Then
On Error Resume Next
intFilterIndex = InStrRev(c, "\")
''used to check if the workbook is open
strIssuesWB = Mid(c, intFilterIndex + 1)
''open the workbook
If Workbooks(strIssuesWB) Is Nothing Then
Workbooks.Open (c)
Else
Workbooks(strIssuesWB).Activate
End If
''check for the issues worksheet
For Each c In ActiveWorkbook.Worksheets
If UCase(c.Name) = "ISSUES" Then GoTo LOADDATA
Next
''exit if not found
MsgBox "There is no 'ISSUES' worksheet in the selected Worth workbook"
''ActiveWorkbook.Close False ''remove the comments from this line if you want to close the workbook
Exit Sub
Else
''exit if no workbook is selected
MsgBox "There is no Worth file selected"
Exit Sub
End If
LOADDATA:
''clear down the old data
Workbooks(strThisWB).Activate
Worksheets("Worth ISSUES").Activate
strTitle = ActiveSheet.UsedRange.Address
strTitle = Mid(strTitle, InStr(strTitle, ":") + 1)
'check if we have valid data to avoid deletign the header
If Mid(strTitle, InStrRev(strTitle, "$") + 1) = 1 Then strTitle = "A2"
''set the range to clear down
strTitle = "A2:" & strTitle
ActiveSheet.Range(strTitle).Select
Selection.ClearContents
''copy the data
Workbooks(strIssuesWB).Activate
Worksheets("ISSUES").Activate
ActiveSheet.UsedRange.Select
Selection.Copy
''paste it in the template workbook
Workbooks(strThisWB).Activate
ActiveSheet.Paste Destination:=Worksheets("Worth ISSUES").Cells(2, 1)
Application.CutCopyMode = False
Cells(1, 1).Select
''remove the issues worksheet
Workbooks(strIssuesWB).Activate
Worksheets("ISSUES").Delete
''close and save the workbook
ActiveWorkbook.Close True
''turn on the alerts
Application.DisplayAlerts = True
End Sub
Bookmarks