Avatar of M Zahid
M Zahid
Flag for United Arab Emirates

asked on 

Copy from one workbook and paste into another

Hi Sirs,

I have written the following code to use is it for frequently paste special/value method of class has failed.

 
Dim wbsurc As Workbook, wbdest As Workbook, flpath As String

'to Open both workbooks: 

Set wbsurc = Workbooks.Open(" C:\1. D Drive\2 - Wrokshop\2 - Working\Vendor List\&Master AML&.xlsb")
Set wbdest = Workbooks.Open(" C:\1. D Drive\2 - Wrokshop\2 - Working\Vendor List\"".xlsb")

'flpath = wbsurc.Path & "\"

'Now, copy from source book:
wbsurc.Sheets("Vend list").Range("A1:C6880").Copy

'Now, paste to target workbook/sheet:

wbdest.Sheets("vend").Range("A1").PasteSpecial

'Close x:
wbsurc.Close
End Sub

Open in new window


Plz help me to fix this plz

thx
M Zahid
Microsoft ApplicationsProgrammingVB ScriptMicrosoft OfficeVBA

Avatar of undefined
Last Comment
M Zahid

8/22/2022 - Mon