concatenating text with address reference

R

RiverGully

Hi,

I am unable to concatenate the word "Total " with a cell address.

Here's my script:
ActiveCell.Offset(0, 1).Formula = "+Total " & " & " & (ObjectHeadAddress)

The result is: +Total & E73

I would like the formula to come out looking like : +"Total "&E73
so that the formulae in the cell is meaningful.

Please advice how to get the extra " " marks around the work Total. When I
try to put in the extra quotation marks, I get the debug error message.

Thank you in advance.
 
N

NOPIK

Buy youself a BASIC or programming manual (seriously, you will
discover a lots of "tricks"). For example, if you need string
quotation character inside the string - just double it:
"""" - will result a " in string.
 
R

RiverGully

Could you provide the example?

When I doubled the quotations it gave a compile error.

Thank you
 
R

RiverGully

Thank you NOPIK - I understand you to mean that not just an extra set of
quotes, but two extra sets around the text. Anyway it works - thank you
again.
 

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

Top