none
Insert a formula into an Excel cell using VBA RRS feed

  • Question

  • Hi

    How can I enter a sum function containing variables into an excel cell using VBA?

    For example, how can I modify the following code so that it will run?

    Sub Test()

    Dim iOne as integer

    Dim iTwo as integer

    iOne=1

    iTwo=6

    Range("B5").Formula= "=SUM(D & iOne:D & iTwo )"

    End Sub

    Regards

    Anthony

    Sunday, July 6, 2014 8:43 PM

Answers

All replies