Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Paste All Problem

Thats brilliant. I was using the macro recorder and it just didnt quite
work.

Many thanks for that!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Paste All Problem

Hi it doesnt throw up an error but that doesnt paste all either

Sorry

Any more ideas

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste Problem Between Ex 97 vs 2k DaveM Excel Discussion (Misc queries) 5 January 30th 08 02:31 PM
Paste problem Pietro Excel Discussion (Misc queries) 2 October 13th 07 06:14 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
CUT & PASTE PROBLEM Todd Excel Discussion (Misc queries) 1 March 10th 05 12:45 AM
Paste Problem Rich[_16_] Excel Programming 1 September 29th 04 12:39 AM


All times are GMT +1. The time now is 01:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"