- ©«¤l
- 967
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 1001
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN XP
- ³nÅ骩¥»
- OFFICE 2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-11-29
- ³Ì«áµn¿ý
- 2022-5-17
|
¦^´_ 1# dechiuan999 - Private Sub CommandButton1_Click()
- Dim mRng As Range
- Dim mRng1 As Range
- Dim mRng2 As Range
- Dim mRng3 As Range
- Dim mTotal%
- Dim oldMonth
- Dim mSht As Worksheet
- Dim mRow As Integer
-
- Set mSht = Worksheets(1)
- With mSht
- mRow = .Range("a1").End(xlDown).Row
- Set mRng = .Range("g1:l" & mRow)
- Set mRng1 = .Range("a2:a12")
- Set mRng2 = .Range("f2:f12")
- mTotal = Application.WorksheetFunction.Max(mRng2)
- Set mRng3 = Union(mRng1, mRng2)
- End With
-
- oldMonth = Month(Date) - 1
- Application.ScreenUpdating = False
- '·s¼W¹Ïªí¤§X¦ì¸m Y¦ì¸m ¼e °ª
- Set mychart = Sheet1.ChartObjects.Add(350, 0, 400, 200)
-
- Select Case mTotal
- Case 1 To 100
- mTotal = "100"
- Case 101 To 200
- mTotal = "200"
- Case 201 To 300
- mTotal = "300"
- Case 301 To 400
- mTotal = "400"
- Case 401 To 500
- mTotal = "500"
- Case esle
- mTotal = mTotal
- End Select
-
- With mychart.Chart
- .SetSourceData Source:=mRng3, PlotBy:=xlColumns
- .HasTitle = True
- .ChartType = xlColumnClustered
- .HasLegend = False
- .ApplyDataLabels xlDataLabelsShowValue
- '.Axes(xlCategory).TickLabels.Orientation = xlHorizontal
- .ChartTitle.Characters.Text = oldMonth & " ¤ë¥÷²Îpªí"
- .ChartTitle.Font.Bold = False
- .ChartTitle.Font.Size = 12
- .PlotArea.Top = 16
- .PlotArea.Height = 160
- .Axes(xlValue).MaximumScale = mTotal
- .Axes(xlCategory, xlPrimary).HasTitle = False
- .Axes(xlValue, xlPrimary).HasTitle = False
- .ChartArea.Font.Size = 8
- .ChartTitle.Font.Size = 10
- End With
-
- Application.ScreenUpdating = True
-
- End Sub
½Æ»s¥N½X
TEST¤G.rar (13.05 KB)
|
|