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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manipulating a Characters object

Status
Not open for further replies.

RobBroekhuis

Technical User
Oct 15, 2001
1,971
US
Hi,
I'm trying to create an axis title from the value of a worksheet cell, including the formatting that is present in the cell. I can't figure out what I'm doing wrong. My code is:
Code:
   dim Attl as Axistitle
   set Attl=activechart.axes(xlvalue).axistitle
   Attl.Characters.Text = cell
   For j = 1 To Len(cell)
      With Attl.Characters(j).Font
         .Name = cell.Characters(j).Font.Name
         .Subscript = cell.Characters(j).Font.Subscript
         .Superscript = cell.Characters(j).Font.Superscript
      End With
   Next j
This properly assigns the value in the cell to the axistitle, but the formatting is lost. What am I missing?
Rob

 
This might work:
Code:
Dim MyCellFormat As Variant

MyCellFormat = cell.FormatConditions
Attl.Characters.Text = WorksheetFunction. _
                       Text(cell, MyCellFormat)
Comment out all the code after the
Code:
Set
statement and toss this in. ----------------------------------------
If you are reading this, then you have read too far... :p

lightwarrior@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top