Populating a cell with concatenated text...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to enter a combination text/cell value in a cell, but vba won't let
me. It expects the end of the statement. Example: Range("A5").Formula = _
"=Summary of "&Q1&" manual comparison."

.... where Range("Q1") could be "Current" or "MTD".

Any help would be appreciated.

Sam
 
Sam:

Try:

You need to put the text in quotes:

Range("A5").Formula = _
"=""Summary of "" & Q1 & "" manual comparison."""
 
Sam

Need a few more double quotes.

Range("A5").Formula = "=""Summary of "" & B1 & "" manual comparison."""


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top