Paste Failure

SimplyErick

New Member
Joined
Feb 3, 2012
Messages
10
The following code is failing randomly, when I step throught it(f8) the code executes. Any thoughts on why this might be failing?

Dim S as Integer
Dim E as Integer
Dim WBT as WorkBook
Dim WS16C as WorkSheet

WS16C.Range("H" & S & ":H" & E).Copy
With WBT.Sheets("CPC Analysis").Range("C7")
.PasteSpecial
.Activate
ActiveSheet.Paste Link:=True
End With
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
What are your values of S and E when it fails?
If S was 1, and E was the last possible row on an Excel sheet, then it would cause errors, because pasting it to row 7 would try to paste it 6 rows past the last possible row in Excel.

If this is not what is going on, please let us know the exact error message.
 
Upvote 0

Forum statistics

Threads
1,217,409
Messages
6,136,457
Members
450,013
Latest member
k4kamal

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