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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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