Cut & paste with manual calculation

crewaustin66

Board Regular
Joined
Jun 11, 2014
Messages
82
Does anyone know why I get a 1004 Paste method of Worksheet class failed when I try to cut&paste in VBA with Application.Calculation set to manual? Being able to do this would optimize my macro significantly.

Thanks,
Crew

Code:
Application.Calculation = xlCalculationManual

                If ref2Row > 0 Then
                    If ref2Row = ref1Row Then
                        Range("B" & curRow + 1).Select
                    Else
                        Range("B" & curRow).Select
                    End If
                    
                    ActiveSheet.Paste
                Else
                    If ref1Row > 0 Then
                        Range("B" & curRow).Select
                DoEvents
                        'ActiveSheet.Paste
                        ActiveSheet.Paste
                    End If
                End If
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You will need to post the code.

Please use code tags:


[code]
paste your code here
[/code]
 
Upvote 0
Is the sheet protected?

What is the code to copy? Please post the complete code - we are not mind readers.
 
Upvote 0
For whatever reason, I can't paste the code into the board. Odd. It's a simple Range(copyRange).Select followed by a Selection.Copy. I do this before my import data loop and then just .paste the block of cells in the loop before I write the data over it from the imported data. When I do the .paste with Application.Calculation = xlCalculationManual the .paste fails with the
 
Upvote 0
I don't think that this is anything to do with manual calculation.

If you copy a range then open another workbook to paste to this action will clear the clipboard so there is nothing to paste.This scenario would generate a 1004 error.

The solution in this case would be to open the second workbook and then do the copy and paste.
 
Upvote 0
I don't think that this is anything to do with manual calculation.

If you copy a range then open another workbook ...

I copy from the same sheet that I am pasting to. Adding in the manual calculation definitely triggers the 1004.
 
Upvote 0

Forum statistics

Threads
1,222,194
Messages
6,164,508
Members
451,900
Latest member
lamski

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