View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
John John is offline
external usenet poster
 
Posts: 2,069
Default Copy & Paste - Unsafe?

Nick,
I pressed post before completing my earlier response - I was going to
mention that ranges should be same size but you have already covered. I alos
was going to suggest that you can use copy where needed like this:

rngAllocation.Copy Destination:=Sheet2.Range("A1")

which should also by-pass the clipboard.

Hope useful


--
jb


"Nick H" wrote:

I'd still be interested in an answer to the original question, if
anyone else can offer some insight?

However...

---snip---
rngmaster.value = rngAllocation.Value

---snip---

....thanks jb that does the job - and I'm kicking myself for not
thinking of it, having gone to all the trouble of defining both ranges
and making them the same size. Doh! Too much pressure to think
straight I guess

btw, if anyone else decides this is the method for them please note
that if your source range has multiple areas (as mine does actually)
then the destination range must have the same number of areas and they
must be the same size as the source areas. You then need to loop
through each area and equate them separately. Like so...

For i = 1 To rngAllocation.Areas.Count
rngMaster.Areas(i).Value = rngAllocation.Areas(i).Value
Next i

....the same goes for copy & paste but I was trying to keep the
original question simple. ;^)