CopyOrigin on Insert in Excel VBA

前端 未结 3 939
我寻月下人不归
我寻月下人不归 2021-01-01 13:39

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 helpf

3条回答
  •  情歌与酒
    2021-01-01 13:58

    You can Reference here :

    Imports Excel = Microsoft.Office.Interop.Excel
    Dim XLApp As New Excel.Application()
    Dim xWkBook As Excel.Workbook = XLApp.Workbooks.Open(YourInitialPath)
    Dim xSheet As Excel.Worksheet = CType(xWkBook.Sheets(1), Excel.Worksheet)
    
    CurCell = xSheet.Range("G9:G11")
    CurCell.Insert(Excel.XlInsertShiftDirection.xlShiftToRight, CurCell.Copy())
    

提交回复
热议问题