PDA

View Full Version : Retain Contents of Clipboard



ilak1008
08-27-2011, 02:26 AM
I tried to copy the contents from the clipboard using Ctrl-A then Ctrl-C and the codes below worked:

Sheets("Sorted").Select
Cells.Select
ActiveSheet.Paste

Sheets("Data").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
But when I copied it, clear the contents of the cells and then pasted it, I couldn't because it did not retain the contents from the clipboard after clearing the contents of the entire cells. Any help would be greatly appreciated? Thanks.

VoG
08-27-2011, 04:27 AM
Cross posted mrexcel.com/forum/showthread.php?t=574833

GTO
08-27-2011, 04:32 AM
Hi Peter!

I suppose its far too late to way "Welcome", but glad to see you here :-)

Mark

VoG
08-27-2011, 04:38 AM
Hi Mark :hi:

Kenneth Hobs
08-27-2011, 06:45 AM
IF your goal is to retain the clipboard when you do code, you need to just use the Copy method for the range and set the destination. Select is not the best way to do copy pastes.

IF your goal is to retain the clipboard by manual means, use the office Clipboard. In 2010, it is the little arrow icon to the right of the word clipboard on the Home menu's left side.

Aussiebear
08-27-2011, 12:33 PM
Hi ilak1008, Please do not cross post issues onto multiple forums. I note that you have now done so in two threads within the last few hours. If for some reason you feel the need to cross post, then place the link into your post.

ilak1008
08-29-2011, 08:24 AM
IF your goal is to retain the clipboard when you do code, you need to just use the Copy method for the range and set the destination. Select is not the best way to do copy pastes.

IF your goal is to retain the clipboard by manual means, use the office Clipboard. In 2010, it is the little arrow icon to the right of the word clipboard on the Home menu's left side.
Hi Kenneth, thanks for replying. I'm using Excel 2007. What I am trying to do is, I want to copy all the text from another program and paste it automatically in Excel using a Macro. What I did was, I copied everything using Ctrl-A and Ctrl-C. When I cleared the contents of the sheet, the paste didn't work as the clipboard is empty. So what I did was to paste right away without clearing the contents of the sheet. Is there another way to paste the texts even after clearing the contents of the sheet using a Macro? Thanks.

ilak1008
08-29-2011, 08:29 AM
Hi ilak1008, Please do not cross post issues onto multiple forums. I note that you have now done so in two threads within the last few hours. If for some reason you feel the need to cross post, then place the link into your post.
Hi Ausseibear,

:friends:Thanks for bringing it to my attention. I'm not sure what I did but I'm sorry I didn't mean to cross post issues onto multiple forums. It seems that I'm clicking something which I am not supposed to.