Macro hanging/taking long time to react

jaianth2011jan

New Member
Joined
Jan 15, 2011
Messages
4
C:%5CUsers%5Cjayanth.m%5CDesktop%5C12121212.PNG
I have recorded a small macro for sorting purpose but the macro when run in 2010 will take very long after some repetitions of it. The problem is occuring only in a particular column.

But the same macro wen run in excel 2004/2007 runs properly without any problem. Can any1 please help me out to clear the problem as soon as possible.


Below given is that piece of code:
Sub HORtoVER6DATA()
'
' HORtoVER6DATA Macro

'
' Keyboard Shortcut: Ctrl+Shift+Q
'
ActiveCell.Range("A1:A6").Select
Selection.Copy
ActiveCell.Offset(6, 0).Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Cut
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveSheet.Paste
Selection.Copy
ActiveCell.Offset(-5, 0).Range("A1").Select
ActiveSheet.Paste
Selection.Cut
ActiveCell.Offset(5, -1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-6, 1).Range("A1:A12").Select
Selection.ClearContents
ActiveCell.Offset(6, -1).Range("A1").Select
End Sub
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
What cell is selected before you run this macro? And what worksheet are you in?
 
Upvote 0
So far as I can tell from that macro the following would provide the same result

Code:
Sub HORtoVER6DATA()
'
' HORtoVER6DATA Macro

'
' Keyboard Shortcut: Ctrl+Shift+Q
'
With ActiveCell
    .Range("A1:A6").Copy .Offset(6, 0)
End With
Application.CutCopyMode = False
End Sub
 
Upvote 0
d'oh - clearly I didn't read it through enough, yes all it appears to do is cut a range and paste it (and then lots of cell selects!)
 
Upvote 0
Dear Sir,

The main concept behind this is to make the column values on to row values completely
viz:
K1,L1,M1,N1,O1,P1
K2,L2,M2,N2,O2,P2


AND I PUT THE FORMULA IN ROW WISE:

+K1
+L1
+M1
+N1
+O1
+P1

NEXT I NEED THE SERIES AS
+K2
+L2
+M2
+N2
+O2
+P2

BUT IF I SIMPLY COPY IT GIVES
+K7
+L7
+M7
+N7
+O7
+P7

that is why this series of copy pastes are required i think now my thought is clear .

Regards,

Jayanth.M
 
Upvote 0
Do you want to transpose the data?

Code:
Sub Macro1()
    Range("A1:F2").Copy
    Range("A7").PasteSpecial Transpose:=True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,158
Members
452,892
Latest member
yadavagiri

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