Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date format in a text string | Excel Worksheet Functions | |||
Format cells based on text string contains | Excel Worksheet Functions | |||
Format text string | Excel Discussion (Misc queries) | |||
Property Let: assign return value of Double when passing String | Excel Discussion (Misc queries) | |||
SeriesCollection Values Property Oddity | Charts and Charting in Excel |