LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default format text string for SeriesCollection.Name property

I have a plot in which I would like to rename a data series object using
VBA. I use the following code:

Public Sub ChangeSeriesCollectionName()

Dim textString As String

textString = " 104.0 "

ActiveChart.SeriesCollection(1).Name = textString

End Sub

In reality the text string is imported from a 10 character user comment
section in a data file. My problem is that when Excel renames the data
series, it drops the ".0" part simply to "104". This happens despite the use
of the VBA Format function in the form Format(textString."@@@@@@") or
Format(textString."000000") to force either the inclusion of a zero or to
use the text literally (preferred). In addition if I use something like
textString = "A 104.0 " then all the spaces/zeros are accepted without
the use of a Format function probably because it now treats textString as a
real string.

Is there any way to force Excel to accept the above string as is without any
interpretation?

Thanks.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date format in a text string osbornauto Excel Worksheet Functions 15 July 3rd 07 09:06 PM
Format cells based on text string contains Also Excel Worksheet Functions 7 May 14th 07 11:13 AM
Format text string Saintsman Excel Discussion (Misc queries) 2 April 2nd 07 11:56 AM
Property Let: assign return value of Double when passing String Tetsuya Oguma Excel Discussion (Misc queries) 1 March 3rd 06 08:01 AM
SeriesCollection Values Property Oddity Greg Wilson Charts and Charting in Excel 4 December 3rd 05 04:26 AM


All times are GMT +1. The time now is 08:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"