Can't figure out what's wrong with following code: (I keep getting compile error : expected end of statement..and it points to xlPasteFormulas
I've been at it for HOURS now !!???
[VBA]
Sub GenerateQuote()
Dim wbName As String
Dim pathName As String
Dim sheetName As String
Dim rangeName As String
Dim wbook As Workbook
wbName = "pnvtest.xls"
pathName = "C:\New Drive C\Education\VBA\R & D\" & wbName
sheetName = "Details"
rangeName = "addressLine1"
'Check if pnv is open (and ignore error if it isn't)
On Error Resume Next
Set wbook = Workbooks(wbName)
If wbook Is Nothing Then 'Not open
Workbooks.Open (pathName)
Else 'It is open
End If
'Copy over info
With ActiveCell
Range(.Offset(0, 6), .Offset(0, 10)).Copy Workbooks(pathName).Sheets(sheetName).Range(rangeName).PasteSpecial xlPasteFormulas, Transpose:=True
End With
End Sub
[/VBA]