Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

How to Copy a Range from a Source Sheet to a Non-Contiguous Range in a Destination Sheet

$
0
0
 I try the following in my VBA code:               

    strRng = "D22:F23"
    strRng2 = "D23:D24,F23:G23"
    ShMain.Range(strRng).Copy Destination:=ShNew.Range(strRng2)

There are a total of six (6) cells in the first range and six cells in the second range (albeit non-contiguous).  I get the error:

The information cannot be pasted because the Copy area and the paste area are not the same size and shape. Try one of the following:

• Click a single cell, and then paste.
• Select a rectangle that's the same size and shape, and then paste.

HOW can I accomplish copying x contiguous cells in one worksheet to x non-contiguous cells in another sheet?  Thanks for any help.


Doug Pruiett Good News Jail & Prison Ministry Richmond, Virginia www.goodnewsjail.org


Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>