Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste All Problem
Hi I want to paste all into an area.
The area is one cell called ResDownload. I am using this code... Application.Goto Reference:="ResDownload" Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False If i just have one cell copied it works ok. If however i have lots of cells copied from another sheet then i want it to paste them all. However, i get the error.. Runtime Error 1004 PasteSpecial of Range class failed. Is there anyway i can get this working? Thanks in advance! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste All Problem
Hi Simon,
Try: '============= Public Sub Tester() Dim rng As Range Set rng = Selection rng.Copy Destination:=Range("ResDownload") End Sub '<<============= --- Regards, Norman wrote in message oups.com... Hi I want to paste all into an area. The area is one cell called ResDownload. I am using this code... Application.Goto Reference:="ResDownload" Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False If i just have one cell copied it works ok. If however i have lots of cells copied from another sheet then i want it to paste them all. However, i get the error.. Runtime Error 1004 PasteSpecial of Range class failed. Is there anyway i can get this working? Thanks in advance! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste All Problem
Thats brilliant. I was using the macro recorder and it just didnt quite
work. Many thanks for that! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste All Problem
Hi it doesnt throw up an error but that doesnt paste all either
Sorry Any more ideas |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste All Problem
Oh i can see how it works now.
Sorry i was using Tools Macro and running the macro and it was losing the focus of the cells to copy. What i would actually like to do is copy cells from another spreadsheet just simply by using Ctrl+C and thengoing to the speadsheet i want to paste all into and just click a button on the sheet. Any ideas how i can just paste what is already stored in the clip board? Thankyou |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste All Problem
I'm now using
Range("ResDownload").PasteSpecial xlPasteValues This works great on its own... However, i want to be able to clear the contents of of a number of cells with the range ResClear before i paste the values If i use Application.Goto Reference:="ResClear" Application.CutCopyMode = False Selection.ClearContents Range("ResDownload").PasteSpecial xlPasteValues I get the same erro message again. Could this be caus its lost what i am copying? Any ideas? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste All Problem
Hi Simon,
Try: '============= Public Sub Tester() Dim rng As Range Dim destRng As Range Set rng = Selection Set destRng = Range("ResDownload")(1). _ Resize(rng.Rows.Count, rng.Columns.Count) Range("ResDownload").ClearContents rng.Copy destRng.PasteSpecial xlPasteValues End Sub '<<============= -- --- Regards, Norman wrote in message oups.com... I'm now using Range("ResDownload").PasteSpecial xlPasteValues This works great on its own... However, i want to be able to clear the contents of of a number of cells with the range ResClear before i paste the values If i use Application.Goto Reference:="ResClear" Application.CutCopyMode = False Selection.ClearContents Range("ResDownload").PasteSpecial xlPasteValues I get the same erro message again. Could this be caus its lost what i am copying? Any ideas? |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste All Problem
No sorry that doesnt work either.
What im trying to do. Is go to one Spreadsheet . Copy the values i want. Then go to this spreadsheet and clear the content of ResClear and then paste the already copied values into ResDownload Note ResClear is a number of cells ResDownload is just the top left cell of those cells. The guy im trying to do this for said it used to work andnow it doesnt. Cheers |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste All Problem
Hi Simon,
Try: '============= Public Sub Tester() Dim rng As Range Dim destRng As Range Set rng = Selection Range("Resclear").ClearContents Set destRng = Range("ResDownload"). _ Resize(rng.Rows.Count, rng.Columns.Count) rng.Copy destRng.PasteSpecial xlPasteValues End Sub '<<============= --- Regards, Norman wrote in message ups.com... No sorry that doesnt work either. What im trying to do. Is go to one Spreadsheet . Copy the values i want. Then go to this spreadsheet and clear the content of ResClear and then paste the already copied values into ResDownload Note ResClear is a number of cells ResDownload is just the top left cell of those cells. The guy im trying to do this for said it used to work andnow it doesnt. Cheers |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Paste Problem Between Ex 97 vs 2k | Excel Discussion (Misc queries) | |||
Paste problem | Excel Discussion (Misc queries) | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) | |||
CUT & PASTE PROBLEM | Excel Discussion (Misc queries) | |||
Paste Problem | Excel Programming |