I am trying to insert following hyperlink formula into excel cell:
=HYPERLINK("#"&RIGHT(FORMULATEXT(S1);LEN(FORMULATEXT(S1))-1);"Ex-"&P1&" #"&R1&"/"&S1&", "&TEXT(Q1;"dd.mm.yyyy"))
I am trying to do it by following excel VBA code:
Link = "=HYPERLINK(""#""&RIGHT(FORMULATEXT(S" & RowIndexTemp & ");LEN(FORMULATEXT(S" & RowIndexTemp & "))-1);""Ex-""&P" & RowIndexTemp & "&"" #""&R" & RowIndexTemp & "&""/""&S" & RowIndexTemp & "&"", ""&TEXT(Q" & RowIndexTemp & ";""dd.mm.yyyy""))"
ThisWorkbook.Worksheets(Sheet).Cells(RowIndex, ColIndex).Formula = Link
but the result is "Run-time error 1004 Application-defined or object-defined error" on last row (ThisWorkbook... = Link) Where I do error? (I know Add.Hyperlink function but I would like to do it this way.) Thank you for your helping.