Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub 作圖()
- Range("A:A,B:B,D:D,F:F,H:H,J:J,L:L,N:N,P:P,R:R,T:T,V:V,X:X,Z:Z").Select
- Range("P1").Activate
- ActiveSheet.Shapes.AddChart2(240, xlXYScatterSmooth).Select
- ActiveChart.SetSourceData Source:=Range( _
- "A:A,B:B,D:D,F:F,H:H,J:J,L:L,N:N,P:P,R:R,T:T,V:V,X:X,Z:Z" _
- )
- ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
- ActiveChart.SetElement (msoElementPrimaryValueAxisTitleAdjacentToAxis)
- ActiveChart.SetElement (msoElementChartTitleNone)
- ActiveChart.SetElement (msoElementLegendRight)
- ActiveChart.Axes(xlValue, xlPrimary).HasTitle = True
- ActiveChart.Axes(xlCategory).AxisTitle.Select
- ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Text = "V (V)"
- Selection.Format.TextFrame2.TextRange.Characters.Text = "V (V)"
- With Selection.Format.TextFrame2.TextRange.Characters(1, 5).ParagraphFormat
- .TextDirection = msoTextDirectionLeftToRight
- .Alignment = msoAlignCenter
- End With
- With Selection.Format.TextFrame2.TextRange.Characters(1, 5).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 = 10
- .Italic = msoFalse
- .Kerning = 12
- .Name = "+mn-lt"
- .UnderlineStyle = msoNoUnderline
- .Strike = msoNoStrike
- End With
- ActiveChart.Axes(xlValue).AxisTitle.Select
- ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Text = "I (A)"
- Selection.Format.TextFrame2.TextRange.Characters.Text = "I (A)"
- With Selection.Format.TextFrame2.TextRange.Characters(1, 5).ParagraphFormat
- .TextDirection = msoTextDirectionLeftToRight
- .Alignment = msoAlignCenter
- End With
- With Selection.Format.TextFrame2.TextRange.Characters(1, 5).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 = 10
- .Italic = msoFalse
- .Kerning = 12
- .Name = "+mn-lt"
- .UnderlineStyle = msoNoUnderline
- .Strike = msoNoStrike
- End With
- ' 設定位置
- With ActiveChart.Parent
- .Top = Range("D10").Top
- .Left = Range("D10").Left
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment