Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CopyOrigin on Insert in Excel VBA

Tags:

Can anyone tell me what the CopyOrigin parameter of Insert is used for? And what values it will accept?

I have included the vba help (which wasn't really that helpful):

Inserts a cell or a range of cells into the worksheet or macro sheet and shifts other cells away to make space.

expression.Insert(Shift, CopyOrigin) expression Required. An expression that returns a Range object.

Shift Optional Variant. Specifies which way to shift the cells. Can be one of the following XlInsertShiftDirection constants: xlShiftToRight or xlShiftDown. If this argument is omitted, Microsoft Excel decides based on the shape of the range.

CopyOrigin Optional Variant. The copy origin.

like image 475
Craig T Avatar asked Mar 26 '09 04:03

Craig T


1 Answers

It takes either of one parameter as given below.

Const xlFormatFromLeftOrAbove = 0  Member of Excel.XlInsertFormatOrigin 

and...

Const xlFormatFromRightOrBelow = 1  Member of Excel.XlInsertFormatOrigin 
like image 159
lakshmanaraj Avatar answered Oct 11 '22 16:10

lakshmanaraj