0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

EXCEL:選択中のセル範囲で散布図を作成するマクロ

Last updated at Posted at 2020-05-11

選択データの散布図を作成するマクロのメモ書きです。

Option Explicit

Sub MakeGraph()
    
    Const CHART_WIDTH As Long = 300
    Const CHART_HEIGHT As Long = 300
    
    Dim myShapes As Shapes
    Set myShapes = ActiveSheet.Shapes
    
    Dim myChart As Shape
    Set myChart = myShapes.AddChart(xlXYScatterLinesNoMarkers)
    
    With myChart
        .Chart.Legend.IncludeInLayout = False
        .Chart.Legend.Position = xlLegendPositionCorner
        .Width = CHART_WIDTH
        .Height = CHART_HEIGHT
        .Line.Visible = msoFalse
    End With
    
End Sub
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?