Failing paste special to another worksheet

hansgrandia

Board Regular
Joined
Jan 10, 2015
Messages
53
Hi,

I'm attempting to copy from one file to another. Successfully. Next step is to bring (paste) it to the correct position within the file. That's failing in the last row of this code.
What could solve this issue? Support is appreciated! Thanks Hans (Netherlands).

Code:
'Transfer to another file
Set wbThis = ActiveWorkbook
strName = ActiveSheet.Name
Set wbTarget = Workbooks.Open("\\vulog.local\dfs\Users\grandh\Desktop\Handy\Warehouse_KPI's_MT_2017.xlsx")
wbTarget.Worksheets("bron").Select
wbTarget.Worksheets("bron").Range("A1:A7").ClearContents
wbThis.Activate
Application.CutCopyMode = False
wbThis.Worksheets("Jobtime").Range("J2:J8").Copy
wbTarget.Worksheets("bron").Range("A1").PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
wbTarget.Worksheets("bron").Activate
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "#,##0"
Selection.Copy
Application.CutCopyMode = False
Sheets("input").Activate
Range("A2").Select
Selection.End(xlToRight).Offset(0, 1).Select
[COLOR=#ff0000]ActiveCell.PasteSpecial xlPasteValues[/COLOR]
 
Last edited:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I think it is because you do a
Code:
[COLOR=#333333]Application.CutCopyMode = False[/COLOR]
before you do the paste, thereby cancelling the copy/paste. Try moving it after your paste special
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,842
Members
449,471
Latest member
lachbee

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top