judgejustin
Board Regular
- Joined
- Mar 3, 2014
- Messages
- 139
I am running this code and everything works up to the first line where it's suppose to paste. The next couple of lines after the first paste line may not work either but I haven't gotten that far in testing. I have played around with everything I know and can't figure this out.
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column <> 14 Then Exit Sub
Dim FilteToOpen As Variant
Dim OpenBook As Workbook
sPath = ThisWorkbook.Path & "\"
Application.ScreenUpdating = False
Workbooks.Open Filename:=sPath & ActiveCell.Offset(, -11) & ".xlsm", UpdateLinks:=True
Sheets("AGR").Range("K11").Copy
ThisWorkbook("County Data File.xlsm").Worksheets("Statistics").Range(ActiveCell).PasteSpecial xlPasteValues
OpenBook.Sheets("AGR").Range("K9").Copy
ThisWorkbook.Worksheets("Statistics").Range(ActiveCell.Offset(, 1)).PasteSpecial xlPasteValues
OpenBook.Close True
Application.ScreenUpdating = True
End Sub