- ©«¤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
        
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-4-5 08:13 ½s¿è
¦^´_ 5# dechiuan999
Do Until .SeriesCollection.Count = 4 '°õ¦æ°j°é: Until ( ¤@ª½¨ì) ±ø¥ó¦¨¥ß(¼Æ¦CªºÁ`¼Æ=4 ) ®É ¤£°õ¦æ°j°é
.SeriesCollection(5).Delete '§R°£²Ä5ӼƦC¸ê®Æ
Loop- Option Explicit
- Sub Ex()
- Dim Rng(2) As Range, xl As Integer
- With Worksheets("·í¤ë²Îpªí¤Î¹Ïªí")
- .ChartObjects.Delete '§R°£©Ò¦³¹Ïªí
- Set Rng(0) = .Range("a1").Resize(.[a1].End(xlDown).Row - 1, .[a1].End(xlDown).End(xlToRight).Column) '¹Ïªí©ñ¸m½d³ò
- Set Rng(1) = .[B17:T21] '°ò¶©,¥x¥_´ä,¤»°ô,«n®rªøºa,®ç¶é µ¥Ãö¼Æ¾Ú
- Set Rng(2) = .[B25:F29] '¤°ôÃö¼Æ¾Ú
- With .ChartObjects.Add(Rng(0)(1).Left, Rng(0)(1).Top, Rng(0).Width, Rng(0).Height).Chart
- .Parent.Name = "¦UÃö°Ï³fª«¦s©ñ³B©Ò²Îpªí"
- For xl = 2 To Rng(1).Rows.Count
- With .SeriesCollection.NewSeries '«Ø¥ß·s¼Æ¦C
- .Name = Rng(1).Cells(xl, 0) '¦C¦WºÙ
- .Values = "=" & Rng(1).Rows(xl).Address(, , xlR1C1, 1) & "," & Rng(2).Rows(xl).Address(, , xlR1C1, 1)
- '.Values: ·s¼Æ¦CªºÈ-> ³s±µ Rng(1),Rng(2) ªº R1C1¦¡ ¦ì§}
- .XValues = "=" & Rng(1).Rows(1).Address(, , xlR1C1, 1) & "," & Rng(2).Rows(1).Address(, , xlR1C1, 1)
- ' .XValues: ·s¼Æ¦C X¶b¼ÐÅÒ
- End With
- Next
- .HasTitle = True '·s¼W¹Ïªí«á ¨S¦³«ü©w¹Ïªí¸ê®Æ½d³ò ©T¶·¦b ¸ê®Æ½d³ò«ü©w«á
- .ChartTitle.Characters.Text = Format(DateAdd("M", -1, Date), "oooo") & " ¥÷¦UÃö°Ï³fª«¦s©ñ³B©Ò²Îpªí ( " & Application.Sum(Rng(1), Rng(2)) & " ¥÷)"
- .ApplyDataLabels AutoText:=True '¦Û°ÊÅã¥Ü¾A·íªº¼ÆÈ
- End With
- End With
- End Sub
½Æ»s¥N½X |
|