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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,186
Members
449,071
Latest member
cdnMech

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
Back
Top