C
Cooper, Scott A.
Excel programing help shows CopyOrigin as a parameter for insert method but I
can't find out what it is or how it works. What I'd like to do is copy a
range of cells and insert them in places but I also need to insert a blank
row before the copied range so 'copy/paste' approach is out. If this
parameter does it, then how does it work else, how else can I do this?
For i = 3 To iRowCnt
Select Case oWrkSheet.Cells(i, 3).Value
Case "J"
oWrkSheet.Rows(i).Insert shift:=xlShiftDown
oWrkSheet.Rows(i).Insert shift:=xlShiftDown
CopyOrigin:=oWrkSheet.Rows(2)
oWrkSheet.Cells(i, 1).Value = "Software"
oWrkSheet.Cells(i, 1).Font.Bold = True
Case "S"
oWrkSheet.Rows(i).Insert shift:=xlShiftDown
oWrkSheet.Cells(i, 1).Value = "Service & Support"
oHeadRow.Insert shift:=xlShiftDown
Case "P"
oWrkSheet.Rows(i).Insert shift:=xlShiftDown
oWrkSheet.Cells(i, 1).Value = "Training"
oHeadRow.Insert shift:=xlShiftDown
End Select
Next
can't find out what it is or how it works. What I'd like to do is copy a
range of cells and insert them in places but I also need to insert a blank
row before the copied range so 'copy/paste' approach is out. If this
parameter does it, then how does it work else, how else can I do this?
For i = 3 To iRowCnt
Select Case oWrkSheet.Cells(i, 3).Value
Case "J"
oWrkSheet.Rows(i).Insert shift:=xlShiftDown
oWrkSheet.Rows(i).Insert shift:=xlShiftDown
CopyOrigin:=oWrkSheet.Rows(2)
oWrkSheet.Cells(i, 1).Value = "Software"
oWrkSheet.Cells(i, 1).Font.Bold = True
Case "S"
oWrkSheet.Rows(i).Insert shift:=xlShiftDown
oWrkSheet.Cells(i, 1).Value = "Service & Support"
oHeadRow.Insert shift:=xlShiftDown
Case "P"
oWrkSheet.Rows(i).Insert shift:=xlShiftDown
oWrkSheet.Cells(i, 1).Value = "Training"
oHeadRow.Insert shift:=xlShiftDown
End Select
Next