none
VBA移植到VSTO

    问题

  • Private Sub CommandButton1_Click()
        Dim sh As Worksheet, Rng As Range, nL%, nRow%, s%, nRs%
        Set Rng = Sheets(Split(TextBox2.Value, "!")(0)).Range(Split(TextBox2.Value, "!")(1))
        nL = Rng.Column
        s = Val(TextBox1.Value)
        nRs = Rng.Rows.Count + Val(TextBox3.Value)
        Application.ScreenUpdating = False
        Application.EnableEvents = False
        With ActiveSheet
            nRow = .UsedRange.Row + .UsedRange.Rows.Count + Val(TextBox3.Value)
            For i = 1 To s
                Rng.Copy Cells(nRow, nL)
                nRow = nRow + nRs
            Next
        End With
        Application.EnableEvents = True
        Application.ScreenUpdating = True
        
    End Sub
    这段代码在VBA中测试没有问题,如何移植到VSTO中?求解
    2016年1月28日 6:48

答案