Home » excel » ms access – How to refer to cell without A1 notation?

ms access – How to refer to cell without A1 notation?

Posted by: admin May 14, 2020 Leave a comment

Questions:

In my Access VBA I have hyperlink, which is using the following way to link to cell:

oSheet.Cells(1, i).Formula = "=HYPERLINK(""#Sheet2!E6"", """ & !TestCase & """)"

However, instead of E6, I want to use row,col notation, since all my internal application logic is using Cells/rows/cols.

Thanks.

How to&Answers:

Instead of Formulause FormulaR1C1(Row / Column format)

Here are two examples:

Set the formula of your cells to =$B$1 :

oSheet.Cells(1, i).FormulaR1C1 = "=R1C2"

Set the formula of A1 to =C2, A2 to =C3 etc.:

Range("A1:A10").FormulaR1C1 = "=R[1]C[2]"