Macros written in 2007 hang in 2013

AntonSRA

New Member
Joined
Oct 24, 2014
Messages
3
Hello folks,

I have code which is copying and pasting cell values and I am finding the line ActiveSheet.Paste is causing the macro to hang now that I am running in 2013. I have made sure the libraris under Tools->References are the same as in my version of 2007. I have tried replacing the ActiveSheet statement with a reference to the precise sheet name to no avail. Can anyone help me please?

Anton
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Sorry, here is my code:

Sub Generate_Exact_Tdcr_List_2()
Sheets("H-Stage_Pass_List").Activate
'Check for no hits.
Range("A4").Select
If ActiveCell.Value = "" Then
Exit Sub
Else: End If
'Generates list of discrete Horn_SN.
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.End(xlToRight).Select
Range("BE3").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveSheet.Range("$BE$3:$BE$103").RemoveDuplicates Columns:=1, Header:=xlNo
'Fill formula down.
Range("BF4").Select
Range("BF4:BF2500").Select
Selection.FillDown
Range("BE3").Select
'Delete excess formulae.
Selection.End(xlDown).Select
ActiveCell.Offset(1, 1).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
End Sub
 
Upvote 0
I have begun re-writing the code to try to get to the bottom of the problem and in fact excel is crashing when I try to paste the cells into the destination manually, so it appears to be nothing to do with VBA at all!
 
Upvote 0

Forum statistics

Threads
1,216,190
Messages
6,129,421
Members
449,509
Latest member
ajbooisen

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