All pastes #794472 Raw Edit

Untitled

public text v1 · immutable
#794472 ·published 2007-11-23 04:25 UTC
rendered paste body

      Sub Macro6()
      Dim X
      X = ActiveSheet.Name
      Charts.Add
      ActiveChart.ChartType = xlXYScatterLines
      ActiveChart.SeriesCollection(1).XValues = Sheets("Sheet1").Range("A2:A8")
     ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("D1:D8")
      ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Mike Jones At Bats"
      With ActiveChart
              .HasTitle = True
              .ChartTitle.Characters.Text = "Mike Jones At Bats"
              .Axes(xlCategory, xlPrimary).HasTitle = True
              .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Year"
              .Axes(xlValue, xlPrimary).HasTitle = True
              .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "At Bats"
          End With
          With ActiveChart
              .HasAxis(xlCategory, xlPrimary) = True
              .HasAxis(xlValue, xlPrimary) = True
          End With
          ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
          ActiveChart.HasLegend = False
      End Sub