MACRO to build a graph - y axis not shown
Results 1 to 3 of 3

Thread: MACRO to build a graph - y axis not shown
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jun 2019
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default MACRO to build a graph - y axis not shown

    Hi all
    I managed to create a macro to build a graph which updates each time the lenght of the columns change.
    When I try to put the name of the horizontal axis, it work. When I try to do the same with the vertical axis it doesn't.
    Anyone willing to help?
    I am very grateful

    Thanks a lot
    valentina

  2. #2
    Board Regular
    Join Date
    Dec 2018
    Posts
    71
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: MACRO to build a graph - y axis not shown

    Hello, could you share your code?

  3. #3
    New Member
    Join Date
    Jun 2019
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: MACRO to build a graph - y axis not shown

    Dear Lavina - yes thanks

    Sub graphJ()
    '
    ' graphJ Macro
    '
    Dim i As Integer
    i = Cells(53, 55).Value
    Range(Cells(3, 52), Cells(i, 53)).Select
    ActiveSheet.Shapes.AddChart2(240, xlXYScatterSmoothNoMarkers).Select
    ActiveChart.SetSourceData Source:=Range(Cells(3, 52), Cells(i, 53))
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.FullSeriesCollection(1).Name = "=""FLOD"""
    ActiveChart.FullSeriesCollection(2).Name = "=""MIN"""
    ActiveChart.FullSeriesCollection(2).XValues = Cells(3, 56)
    ActiveChart.FullSeriesCollection(2).Values = Cells(3, 55)
    ActiveChart.ChartTitle.Text = "Flood Mechanism"
    ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
    Selection.Format.TextFrame2.TextRange.Characters.Text = "AA"
    ActiveChart.SetElement (msoElementPrimaryValueAxisTitleAdjacentToAxis)
    ActiveChart.SetElement (msoElementLegendBottom)
    ActiveChart.FullSeriesCollection(2).Points(1).Select
    With Selection
    .MarkerStyle = -4142
    .MarkerSize = 5
    End With
    Selection.MarkerStyle = 2
    Range("BG5").Select
    '
    End Sub

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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