MrNoNo
MrNoNo

Reputation: 65

VBA - Show Formula in cell when variable value

The code below shows only value in cell. How do I make it show the whole path from where it was taken?

If Worksheets("Final").Cells(j, 8).value = "Gross" Then
      Worksheets("Final").Cells(j, 11).value = .Cells(i, 2).value
      Worksheets("Final").Cells(j, 12).value = "=(" & .Cells(i, 2).value & ")"
End If

It shows the value only:

enter image description here I would like it to show:

enter image description here

Upvotes: 0

Views: 46

Answers (1)

HTH
HTH

Reputation: 2031

Worksheets("Final").Cells(j, 12).Formula = "='" & .Name & "'!" & .Cells(i, 2).Address(False, False)

Upvotes: 1

Related Questions