Insert String Between Dates in Chart Title

R

RyanH

I have a chart that displays data between two dates. I want the title to
read like this:

Range("A2").Value & " to " & Range("B2").Value

I highlighted the title box and entered this in the formula bar and Excel
will not accept it, why?

=Summary!$A$2&" to "&Summary!$B$2
 
K

klswvu

If you are entering this in the Excel formula bar, try:

=A2&" to"&B2

The syntax looks like you are using VBA code outside of a macro.
 
P

Peo Sjoblom

One way would be to put this formula in a cell, assume you put it in K3

(or hide it away in IV2 or something)


=TEXT(Summary!$A$2,"mm/dd/yyyy")&" to "&TEXT(Summary!$B$2,"mm/dd/yyyy")


(adapt to fit the regional date format you are using)



then click in the title of the chart and type an equal sign and click on K3


so the title when selected would read


=Summary!$K$3



that way it would be dynamic and display as


10/12/2008 to 10/28/2008



as an example

--


Regards,


Peo Sjoblom
 
R

RyanH

I apologize for the confusion. I am not writing VBA code. I tried entering
what you have and I get an Exclamation MsgBox saying "References in series
formulas must be external references to worksheet."

A few more details. The chart is embedded in a worksheet, it is not its own
worksheet. When I select the title of the chart and then enter =Summary!$A$2
Excel accepts that and the title show the date in A2. but when I enter
=Summary!$A$2&" to "&Summary!$B$2 Excel doesn't except it.
 
R

RyanH

I tried this already in another cell and it works fine:
=TEXT(Summary!$A$2,"mm/dd/yyyy")&" to "&TEXT(Summary!$B$2,"mm/dd/yyyy")


Any ideas on why you can't put this in the formula bar for the chart title?
--
Cheers,
Ryan


Peo Sjoblom said:
One way would be to put this formula in a cell, assume you put it in K3

(or hide it away in IV2 or something)


=TEXT(Summary!$A$2,"mm/dd/yyyy")&" to "&TEXT(Summary!$B$2,"mm/dd/yyyy")


(adapt to fit the regional date format you are using)



then click in the title of the chart and type an equal sign and click on K3


so the title when selected would read


=Summary!$K$3



that way it would be dynamic and display as


10/12/2008 to 10/28/2008



as an example

--


Regards,


Peo Sjoblom
 
P

Peo Sjoblom

I expect that you can only link directly to a cell, not using any function
within that link

--


Regards,


Peo Sjoblom

RyanH said:
I tried this already in another cell and it works fine:
=TEXT(Summary!$A$2,"mm/dd/yyyy")&" to "&TEXT(Summary!$B$2,"mm/dd/yyyy")


Any ideas on why you can't put this in the formula bar for the chart
title?
 

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