When writing string to a cell, VBA inserts extra single quotation marks

后端 未结 2 1178
北海茫月
北海茫月 2020-12-11 06:10

I am trying to write this formula using VBA:

ActiveCell.Value = \"=f(R[-1]C[0],Sheet1!\" & ColumnLetter & i & \")\"

Where Colum

2条回答
  •  生来不讨喜
    2020-12-11 06:43

    The Apostrophe means to Excel that it should interpret it as text.

    Write it to ActiveCell.Formula. That way it is recognized as Formula.

提交回复
热议问题