VBA Formula

  • I am working on a macro that puts formulas in cell-based on the address. Need help figuring out the issue. below is the line I am struggling with. I have moved the quotes and when I do I get a "sub or function not defined" highlighting the word sum. any help is greatly appreciated.


    Cells(7, iKVI).Value = “=“ & Cells(7, iSum).Address(RowAbsolute:=False, ColumnAbsolute:=False)” & “/SUM(“ & Range(Cells(7, iSales), Cells(LastRow, iSales)).Address & “)”

  • Looks like it should be (but I'm unable to test it):

    Code
    Cells(7, iKVI).Value = "=" & Cells(7, iSum).Address(RowAbsolute:=False, ColumnAbsolute:=False) & "/SUM(" & Range(Cells(7, iSales), Cells(LastRow, iSales)).Address & ")"

    You have an extra double-quote after:

    Code
    ColumnAbsolute:=False)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!