- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¦^´_ 7# Scott090
À°§A½m¤@¤U¥\,¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim X(), Y(), XLeft As Single, Ytop As Single, i As Integer
- Dim P As PlotArea, C As Chart, S As Shapes
- Set C = ActiveSheet.ChartObjects(1).Chart '«ü©w¹Ïªí
- Set P = C.PlotArea
- X = C.SeriesCollection(1).XValues 'X¶b¼ÆÈ
- Y = C.SeriesCollection(1).Values 'Y¶b¼ÆÈ
- i = 3 '«ü©w¼ÆÈÂI.
- With C.Axes(1) 'xlCategory 'X¶b
- XLeft = P.InsideWidth / (.MaximumScale - .MinimumScale)
- 'ÂI¼Æ¶¡¶Zªº¼e«×
- End With
- With C.Axes(2) 'xlValue 'Y¶b
- Ytop = P.InsideHeight / (.MaximumScale - .MinimumScale)
- ''ÂI¼Æ¶¡¶Zªº°ª«×
- End With
- XLeft = P.InsideLeft + (XLeft * X(i))
- Ytop = P.InsideTop + P.InsideHeight - (Ytop * Y(i))
- Set S = C.Shapes
- If S.Count <> 0 Then
- C.Parent.Activate
- S.SelectAll
- Selection.Delete
- End If
- With C.Shapes.AddShape(msoShapeRectangle, Left:=XLeft, Top:=Ytop, Width:=100, Height:=50)
- .TextFrame.Characters.Text = "ªþ¥[»¡©ú1:" & Chr(10) & "X: " & X(i) & Space(5) & "Y: " & Y(i)
- End With
- C.Parent.Parent.Activate
- End Sub
½Æ»s¥N½X |
|