Can someone tell me why I am getting an error for the PasteSpecial line? It is error 1004 and reads: "PasteSpecial method of range class failed".
Thanks!
Sub Import()
Dim FName As Variant
Dim wb As Workbook, x As String
FName = Application.GetOpenFilename _
(filefilter:="Excel Files(*.xls),*.xls,All Files (*.*),*.*")
If FName = False Then
MsgBox "Please select a file!!"
Exit Sub
Else
Workbooks.Open Filename:=FName
For Each wb In Workbooks
If wb.Name <> ThisWorkbook.Name Then x = wb.Name
Next wb
Range("B3600").Select
Selection.Copy
Workbooks.Open Filename:="S:\Program Engineering\dieselspec.xls"
Sheets("Data").Activate
Range("H6").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True
End If
End Sub
Bookmarks