Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chr(13) in a text box for excel 1

Status
Not open for further replies.

AGlazer

Programmer
Sep 15, 2002
38
US
Hey, guys.

This is a basic question, but I can't seem to figure it out. I have a script that adds a textbox to a graph. The data in the textbox should look like this:

Joe Shmoe
- a
- b
- c

For some reason, when I'm creating the string (even using either Chr(13) & Chr(10) & Chr(13) or & vbCrLf) it puts them all on the same line with the "unknown character" square between them.

Any ideas?
 
I just ran the following and it worked...

Sub Modify_TextBox()
ActiveChart.Shapes("Text Box 1").Select
Selection.Characters.Text = "Joe Schmoe" & Chr(10) & " - 1" & Chr(10) & " - 2" & Chr(10) & " - 3"
Selection.AutoScaleFont = True
End Sub

Hope this helps. Please advise as to how you make out.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top