+ Reply to Thread
Results 1 to 3 of 3

Chat Legend -Time formatting not working/displayed correct

  1. #1
    Registered User
    Join Date
    05-21-2015
    Location
    Gauteng, South Africa
    MS-Off Ver
    2010
    Posts
    11

    Chat Legend -Time formatting not working/displayed correct

    Hi All,

    I have a macro that determines the average residence times and then charts the nr of particles that lays in a time range (one minute interval) and that has a certain density using a bar chart. In essence I'm showing the residence times that different particles of different densities had during an efficiency test.

    The marco works, the graph is drawn as it should. The legend however does not show the correct time formatting. I am using [h]:mm:ss as a time format in my spreadsheet as a standard and would like to have the same format on the chat legend.

    This is the code that I used to graph:

    Range("BY1").Select
    Selection.End(xlToRight).Select
    SeriesEnd = ActiveCell.Column
    Set xdata = Range(Cells(1, 78), Cells(1, SeriesEnd)) 'x axis data
    Range("BY2").Select
    Number = Range("AN6")

    'Delete old data
    ActiveSheet.ChartObjects("ResTimePerDensity").Activate
    With ActiveChart
    Do Until .SeriesCollection.Count = 0
    .SeriesCollection(1).Delete
    Loop
    End With

    'Add data to chart
    For n = 1 To Number
    If n <= Number Then
    RowNr = ActiveCell.Row
    Set nDataRange = Range(Cells(RowNr, 78), Cells(RowNr, SeriesEnd))
    ActiveSheet.ChartObjects("ResTimePerDensity").Activate
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection(n).Name = Cells(RowNr, 77)
    ActiveChart.SeriesCollection(n).Values = nDataRange
    ActiveChart.SeriesCollection(n).XValues = xdata
    ActiveCell.Activate
    ActiveCell.Offset(rowoffset:=1, columnoffset:=0).Select
    RowNr = ActiveCell.Row
    Else
    Number = 40
    End If

    Next n

    I have added a copy of the graph and a screenshot of what I see when I select a bar on the chart. It will show that the lable for a bar/data set is typed is.

    Is there any way that I will be able to use the [h]:mm:ss time format on the chart legend?

    Thank you in advance for your response

    TL33
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,937

    Re: Chat Legend -Time formatting not working/displayed correct

    Instead of attaching an image, attach a workbook.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    05-21-2015
    Location
    Gauteng, South Africa
    MS-Off Ver
    2010
    Posts
    11

    Re: Chat Legend -Time formatting not working/displayed correct

    Hi Bernie,

    I have stripped away all of the unnecassary sheets and macros from the attached workbook.Only the data that is used by the macro remained.

    I would like to know if it is possible to use the same format in the charts legend as was used in the workbook. And if so, how do I get the legend to look the same. The format used is: [h]:mm:ss;@

    Thank you in advance for your help

    TL33
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 04-10-2015, 09:05 PM
  2. Live chat/chat room
    By SChapman in forum Suggestions for Improvement
    Replies: 1
    Last Post: 05-06-2013, 10:05 PM
  3. Replies: 3
    Last Post: 06-11-2012, 07:06 PM
  4. Having hard time getting formatting correct
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-31-2012, 10:32 AM
  5. Chart data labels are not correct or not displayed
    By Bolton User in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 04-11-2006, 12:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1