(Solved) – How to make and edit radar plot with Excel VBA

  • by
(solved)-–-how-to-make-and-edit-radar-plot-with-excel-vba

I’m trying to made my table in excel into a radar plot with my own editing. But when I use record macro, I’m experiencing some error with my VBA as if my editing won’t work.

I have some VBA Code like:

Sub Macro6()
'
' Macro6 Macro
'
' Keyboard Shortcut: Ctrl Shift S
'
    Range("A1:C8").DataFields
    ColorIndex..Fill(317, xlRadarFilled).DataFields
    Color.  := Item("Data!$A$1:$C$8")
    Color..DataFields
    With ActiveSheet.Shapes("Chart 8").Fill
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorBackground1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = -0.25
        .Solid
    End With
    Color..ActiveSheet = "Data"
    Selection.Format.TextFrame2.TextRange.Characters.Text = "Data"
    With Selection.Format.TextFrame2.TextRange.Characters(1, 4).ParagraphFormat
        .TextDirection = msoTextDirectionLeftToRight
        .Alignment = msoAlignCenter
    End With
    With Selection.Format.TextFrame2.TextRange.Characters(1, 4).Font
        .BaselineOffset = 0
        .Bold = msoFalse
        .NameComplexScript = " mn-cs"
        .NameFarEast = " mn-ea"
        .Fill.Visible = msoTrue
        .Fill.ForeColor.RGB = RGB(89, 89, 89)
        .Fill.Transparency = 0
        .Fill.Solid
        .Size = 14
        .Italic = msoFalse
        .Kerning = 12
        .Name = " mn-lt"
        .UnderlineStyle = msoNoUnderline
        .Spacing = 0
        .Strike = msoNoStrike
    End With
    Color..DataFields
    Color.(msoElementLegendRight)
    Color.(2).DataFields
    With Selection.Format.Fill
        .Visible = msoTrue
        .ForeColor.RGB = RGB(0, 0, 0)
        .Transparency = 0.3999999762
        .Solid
    End With
    With Selection.Format.Fill
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorAccent2
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = 0
        .Transparency = 0.3999999762
        .Solid
    End With
    Color.(1).DataFields
    With Selection.Format.Fill
        .Visible = msoTrue
        .ForeColor.RGB = RGB(0, 0, 0)
        .Transparency = 0.3999999762
        .Solid
    End With
    With Selection.Format.Fill
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorAccent1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = 0
        .Transparency = 0.3999999762
        .Solid
    End With
    Color.(xlValue)..DataFields
    With Selection.Format.Line
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorAccent1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = 0
    End With
    Color..DataFields
    With Selection.Format.Line
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorText1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = 0
        .Transparency = 0
    End With
    Selection.Format.Fill.Visible = msoFalse
    With Selection.Format.TextFrame2.TextRange.Font.Shadow
        .Type = msoShadow25
        .Visible = msoTrue
        .Style = msoShadowStyleOuterShadow
        .Blur = 5
        .OffsetX = 2.4492935983E-16
        .OffsetY = 4
        .RotateWithShape = msoFalse
        .ForeColor.RGB = RGB(0, 0, 0)
        .Transparency = 0.5686300099
        .Size = 100
    End With
    Color.(1).ReadingOrder.DataFields
    With Selection.Format.TextFrame2.TextRange.Font.Shadow
        .Type = msoShadow25
        .Visible = msoTrue
        .Style = msoShadowStyleOuterShadow
        .Blur = 4
        .OffsetX = 2.4492935983E-16
        .OffsetY = 4
        .RotateWithShape = msoFalse
        .ForeColor.RGB = RGB(0, 0, 0)
        .Transparency = 0.5686300099
        .Size = 100
    End With
    With Selection.Format.TextFrame2.TextRange.Font.Shadow
        .Type = msoShadow25
        .Visible = msoTrue
        .Style = msoShadowStyleOuterShadow
        .Blur = 0
        .OffsetX = 2.4492935983E-16
        .OffsetY = 4
        .RotateWithShape = msoFalse
        .ForeColor.RGB = RGB(0, 0, 0)
        .Transparency = 0.5686300099
        .Size = 100
    End With
    Color..DataFields
    With Selection.Format.TextFrame2.TextRange.Font.Shadow
        .Type = msoShadow25
        .Visible = msoTrue
        .Style = msoShadowStyleOuterShadow
        .Blur = 4
        .OffsetX = 2.4492935983E-16
        .OffsetY = 4
        .RotateWithShape = msoFalse
        .ForeColor.RGB = RGB(0, 0, 0)
        .Transparency = 0.5686300099
        .Size = 100
    End With
    ActiveSheet.Shapes("Chart 8").IncrementLeft 252.2058267717
    ActiveSheet.Shapes("Chart 8").IncrementTop -120.5882677165
    ActiveSheet.Shapes("Chart 8").IncrementLeft -12.5
    ActiveSheet.Shapes("Chart 8").IncrementTop -24.2647244094
    Color..DataFields
    Color.(1).ReadingOrder.DataFields
    With Selection.Format.TextFrame2.TextRange.Font.Fill
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorText1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = 0
        .Transparency = 0
        .Solid
    End With
    Color.(xlValue)..DataFields
    With Selection.Format.TextFrame2.TextRange.Font.Fill
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorText1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = 0
        .Transparency = 0
        .Solid
    End With
    With Selection.Format.Line
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorText1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = 0
        .Transparency = 0
    End With
End Sub

I Hope that it will output my Radar Plot like I wanted to but it just can’t. And I’m not really that fluent in excel VBA.

Thank you very much.

Leave a Reply

Your email address will not be published. Required fields are marked *