Not so much bad code as kludge
-
In an excel sub I have to copy and paste a large chunk of data from one workbook to another. On paste I need to close the workbook I copied from, and before I can it shows the message about a large amount of data on the clipboard. My work around?
Selection.Copy Windows("Testbed.xlsm").Activate Range("A1").Select ActiveSheet.Paste Range("A1").Select Selection.Copy ActiveSheet.Paste Windows("test.xlsm").Activate ActiveWindow.Close
Those two lines of copy/paste in the middle save the day, but really ought to be consigned to the dustbin of depression.
------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]
-
In an excel sub I have to copy and paste a large chunk of data from one workbook to another. On paste I need to close the workbook I copied from, and before I can it shows the message about a large amount of data on the clipboard. My work around?
Selection.Copy Windows("Testbed.xlsm").Activate Range("A1").Select ActiveSheet.Paste Range("A1").Select Selection.Copy ActiveSheet.Paste Windows("test.xlsm").Activate ActiveWindow.Close
Those two lines of copy/paste in the middle save the day, but really ought to be consigned to the dustbin of depression.
------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]
-
Can you not use
Application.DisplayAlerts = False
before your copy and thenApplication.DisplayAlerts = True
once your paste has completed? -
Also try Application.CutCopyMode = False