I want to fill a text box on an Excel chart using VBA. I tried this:
ActiveSheet.ChartObjects("Chart 1").Chart.Shapes(1).Formula = "Sheet1!A1"
and it doesn’t work, but this does:
ActiveSheet.ChartObjects("Chart 1").Chart.Shapes(1).Select Selection.Formula = "=Sheet1!A1"
There probably is something I need to put between
.Formula, but I can’t find it. Any suggestions?
Note that the second formula (the one that works) includes an equals sign before the sheet name:
while the first does not: