0

I'm trying to concatenate some cells for customers reports, I know the formula works manually as I have used it many times, but when it comes to putting it into a VBA to automate it as much as possible, I get a compile error: Expected: End of Statement.

The Syntax is:

Range("E8").Value = "=CONCATENATE(E6," ", TEXT(E7,"#,##0.00"))

I get the error message in the part ",text(E7,"

Can anyone advise where I am going wrong?

I've tried adding additional " where I think they could be missing,

Scott Craner
  • 148,073
  • 10
  • 49
  • 81
  • 3
    If you want to use quotation marks in a string you need to use doubled quotes: `Range("E8").Value = "=CONCATENATE(E6,"" "", TEXT(E7,""#,##0.00""))"`. However, I think you should use `.Formula` instead of `.Value` – Gowire Dec 20 '22 at 14:46
  • 1
    Oh my days!! it was that simple!! Thank you so much Gowire, that has resolved the issue! Thank you! – Pauldevans84 Dec 20 '22 at 15:49

0 Answers0