Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Insert Method CopyOrigin ???

6 views
Skip to first unread message

Richard Wilkinson

unread,
Aug 2, 2002, 2:09:14 PM8/2/02
to
We cannot seem to properly implement the CopyOrigin argument of the Insert
Method. We are laboring under the assumption that the CopyOrigin argument
will allow the programmer to specify the range to be inserted. There does
not seem to be any additional help on this argument other than to suggest it
is a variant and specifies the copy origin. If we try to specify a range or
a variant variable containing a range as the copy source, the code line with
the Insert Method will enter a seeming endless loop of blank row insertions.
What is the purpose of this argument and how do we properly specify it?

Thanks,

Richard

John Walkenbach

unread,
Aug 2, 2002, 3:15:26 PM8/2/02
to
Good question. I've never tried to use that argument. The online help is
about as vague as it could possibly be. It seems logical that the CopyOrigin
argument should be the range that you are copying and inserting. So, if you
want to copy range N1:O2 to A1:B2 and shift the existing cells down, this
*should* work (but it doesn't):

Sub Macro1()
Range("A1:B2").Insert Shift:=xlDown, copyOrigin:=Range("N1:O2")
End Sub

Rather, you need to use this:

Sub Macro2()
Range("N1:O2").Copy
Range("A1:B2").Insert Shift:=xlDown
End Sub

I guess it's just another obscure bug in Excel.

John Walkenbach
For Excel tips, macros, & downloads...
http://j-walk.com/ss


"Richard Wilkinson" <mailsp...@cs.com> wrote in message
news:egaDX#kOCHA.1572@tkmsftngp13...

Richard Wilkinson

unread,
Aug 2, 2002, 5:06:41 PM8/2/02
to
Thanks for the reply John. As you suggested, we resorted sometime ago to
living with the work-around you provided. Is there anyway to know if
Microsoft is aware of this issue?

Thanks,

Richard

****************************
"John Walkenbach" <jo...@j-walk.com> wrote in message
news:ut1jtwlOCHA.2416@tkmsftngp09...

0 new messages