Can a chart title contain an integer variable or array index

askinsb

New Member
Joined
Aug 4, 2003
Messages
11
I am querying the worksheet and getting back the values I want and storing the values in an array.

Dim mynumbers(4) as Integer

I then want to update a chart title when the new numbers something like this.

Selection.Characters.Text = _
"Weekly Numbers" & Chr(10) & " mynumbers(1) " & Chr(10) &

How the chart title doesn't like any variable that are Integers and/or indexes in arrays that are Integers.

Any ideas? Can you convert Integers to string?

Brad
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Re: Can a chart title contain an integer variable or array i

Maybe:

Selection.Characters.Text = _
"Weekly Numbers" & Chr(10) & CStr(mynumbers(1)) & Chr(10)

but I think the quotes surrounding mynumbers(1) is your main problem.
 

askinsb

New Member
Joined
Aug 4, 2003
Messages
11
Re: Can a chart title contain an integer variable or array i

Hey Andrew,

Thanks you were right on both accounts.

Here is the code that wound up working for me.

Selection.Characters.Text = _
"Confirmed By Severity" & Chr(10) & "P1 = " & CStr(mynumbers(1)) & Chr(10) & "P2 = " & CStr(mynumbers(2)) & Chr(10) & _
"P3 = " & CStr(mynumbers(3)) & Chr(10) & "P4 = " & CStr(mynumbers(4))

Thanks again.

Brad
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,093
Messages
5,768,047
Members
425,451
Latest member
JohnBrooksBiddle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top