locked
Passing parameter to r1c1 formula RRS feed

  • Question

  • Hi

    I have the following code 

      Range("A1").Value = "= TEXT(R6C7,""DD"")"

    but instead   6 and 7 of the R6C7 i would like to use variable 

    Thanks 

    Thursday, July 9, 2020 11:23 AM

Answers

  • For example:

        Dim r As Long
        Dim c As Long
        r = 6
        c = 7
        Range("A1").FormulaR1C1 = "=TEXT(R" & r & "C" & c & ",""dd"")"


    Regards, Hans Vogelaar (https://www.eileenslounge.com)

    • Marked as answer by Shay_w Sunday, July 12, 2020 8:21 AM
    Thursday, July 9, 2020 11:27 AM