½Ð¦U¦ì¤j¤jÀ°¦£×§ï«Ø¥ß®r¤J¹Ïªí¿ù»~»yªk
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 20# lamihsuen
½Ð±N drawStatistics() ¾ãÓ©â´«±¼¡G- Sub DrawStatistics(ct As Integer)
- Dim tbl As String
- Dim totalRow As Long
- Dim StartKBarRow, EndKBarRow As Long
- ' StartKBarRow = 6
- With Worksheets(ct)
- tbl = .Name
- ' sPos(1) = CInt(Mid("205*090*090*100*132*096*132*090*173*090*314*090", (ct - 4) * 4 + 1, 3)) ' ¹Ï¼Ð®y¼Ð(¦C)
- ' ¬°¦Ò¶q¦b¹ê°È¹B¥Î¤W¡A¨C±iªí³æ¤º§t¸ê®Æ¤º®e¤§¦h¹è¤£¤@¡A¥i¯à¹ê»Ú¨Ï¥Î¦C¼Æ®É¦³¼W´î¡A¬G§ï¥H°ÊºA³B²z¡C
- sPos(1) = .UsedRange.Rows.Count ' ¥H c ¬°¨Ò¡AÁ`¦@¨Ï¥Î(¿é¤J)¤F 204 Rows ¸ê®Æ¿ý¡C
- While IsEmpty(.Cells(sPos(1), 3).Value) And sPos(1) > 6 ' ©|¶·¦A¦¸¹LÂo³¡¤ÀªÅ¥Õ»P«D¯u¹ê¶×¤J¸ê®Æªº°ÝÃD¦C
- sPos(1) = sPos(1) - 1
- Wend
-
- ' EndKBarRow = .Range("A1").CurrentRegion.Rows.Count ' ¥H c ¬°¨Ò¡A§PÂ_A1:A51°Ï¶¡¹ê»Ú¨Ï¥Î¤F(¦@¦³)¦h¤Ö¦C(Rows)
- ' ¥H c ¬°¨Ò¡AA155:A204 ¶¡Á`¦@¨Ï¥Î¤F¦h¤Ö¦C(50)¡C±µµÛ¦A¨D¥X¤W¤@Ӱ϶¡ªº³Ì«á¤@¦æªº©Ò¦b¦æ¼Æ (204-50-2(ªÅ¥Õ¦C)=152)¡C
- EndKBarRow = sPos(1) - .Range("A" & sPos(1)).CurrentRegion.Rows.Count - 2
- ' ¥H c ¬°¨Ò¡A A105:A152 ¶¡Á`¦@¨Ï¥Î¤F¦h¤Ö¦C(48)¡C±µµÛ¦A¨D¥X¥»°Ï¶¡ªº²Ä¤@¦æªº©Ò¦b¦æ¼Æ (152-48+5(¼ÐÃD¦C)=109)¡C
- StartKBarRow = EndKBarRow - .Range("A" & EndKBarRow).CurrentRegion.Rows.Count + 5
- If (StartKBarRow < 6) Then StartKBarRow = 6 ' < 6 «h¥[ 1¡A ¦]°_©l¦C³Ì¤Ö¬° 6¡C
-
- Set Chart_Source = Range(tbl & "!$C$" & CStr(StartKBarRow) & ":" & tbl & "!$C$" & CStr(EndKBarRow))
-
- sPos(1) = sPos(1) + 5 ' ¹Ï¼Ð®y¼Ð(¦C)
- sPos(2) = CInt(Mid("001*001*001*001*001*001*001*001*001*001*001*001", (ct - 4) * 4 + 1, 3)) ' ¹Ï¼Ð®y¼Ð(Äæ)
- sPos(3) = CInt(Mid("900*900*900*900*900*900*900*900*900*900*900*900", (ct - 4) * 4 + 1, 3)) ' ¹Ïªí¼e«×
- sPos(4) = CInt(Mid("320*320*320*320*320*320*320*320*320*320*320*320", (ct - 4) * 4 + 1, 3)) ' ¹Ïªí°ª«×
- xText = UCase(tbl) & " : Z - Score"
- »s¹Ïµ{§Ç xlSh:=tbl
- End With
- End Sub
½Æ»s¥N½X ±ß¦w¡I |
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 20# lamihsuen
Sub DrawStatistics(ct As Integer)
Dim tbl As String
Dim totalRow As Long
Dim StartKBarRow, EndKBarRow As Long
' StartKBarRow = 6
With Worksheets(ct)
tbl = .Name
' sPos(1) = CInt(Mid("205*090*090*100*132*096*132*090*173*090*314*090", (ct - 4) * 4 + 1, 3)) ' ¹Ï¼Ð®y¼Ð(¦C)
' ¬°¦Ò¶q¦b¹ê°È¹B¥Î¤W¡A¨C±iªí³æ¤º§t¸ê®Æ¤º®e¤§¦h¹è¤£¤@¡A¥i¯à¹ê»Ú¨Ï¥Î¦C¼Æ®É¦³¼W´î¡A¬G§ï¥H°ÊºA³B²z¡C
sPos(1) = .UsedRange.Rows.Count ' ¥H c ¬°¨Ò¡AÁ`¦@¨Ï¥Î(¿é¤J)¤F 204 Rows ¸ê®Æ¿ý¡C
While IsEmpty(.Cells(sPos(1), 3).Value) And sPos(1) > 6 ' ©|¶·¦A¦¸¹LÂo³¡¤ÀªÅ¥Õ»P«D¯u¹ê¶×¤J¸ê®Æªº°ÝÃD¦C
sPos(1) = sPos(1) - 1
Wend
' EndKBarRow = .Range("A1").CurrentRegion.Rows.Count ' ¥H c ¬°¨Ò¡A§PÂ_A1:A51°Ï¶¡¹ê»Ú¨Ï¥Î¤F(¦@¦³)¦h¤Ö¦C(Rows)
' ¥H c ¬°¨Ò¡AA155:A204 ¶¡Á`¦@¨Ï¥Î¤F¦h¤Ö¦C(50)¡C±µµÛ¦A¨D¥X¤W¤@Ӱ϶¡ªº³Ì«á¤@¦æªº©Ò¦b¦æ¼Æ (204-50-2(ªÅ¥Õ¦C)=152)¡C
EndKBarRow = sPos(1) - .Range("A" & sPos(1)).CurrentRegion.Rows.Count - 2
' ¥H c ¬°¨Ò¡A A105:A152 ¶¡Á`¦@¨Ï¥Î¤F¦h¤Ö¦C(48)¡C±µµÛ¦A¨D¥X¥»°Ï¶¡ªº²Ä¤@¦æªº©Ò¦b¦æ¼Æ (152-48+5(¼ÐÃD¦C)=109)¡C
StartKBarRow = EndKBarRow - .Range("A" & EndKBarRow).CurrentRegion.Rows.Count + 5
If (StartKBarRow < 6) Then StartKBarRow = 6 ' < 6 «h¥[ 1¡A ¦]°_©l¦C³Ì¤Ö¬° 6¡C
Set Chart_Source = Range(tbl & "!$C$" & CStr(StartKBarRow) & ":" & tbl & "!$C$" & CStr(EndKBarRow))
sPos(1) = sPos(1) + 5 ' ¹Ï¼Ð®y¼Ð(¦C)
sPos(2) = CInt(Mid("001*001*001*001*001*001*001*001*001*001*001*001", (ct - 4) * 4 + 1, 3)) ' ¹Ï¼Ð®y¼Ð(Äæ)
sPos(3) = CInt(Mid("900*900*900*900*900*900*900*900*900*900*900*900", (ct - 4) * 4 + 1, 3)) ' ¹Ïªí¼e«×
sPos(4) = CInt(Mid("320*320*320*320*320*320*320*320*320*320*320*320", (ct - 4) * 4 + 1, 3)) ' ¹Ïªí°ª«×
xText = UCase(tbl) & " : Z - Score"
»s¹Ïµ{§Ç xlSh:=tbl
End With
End Sub |
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-7-22 08:01 ½s¿è
2012/7/22 ¥[¤J XValues ³]©w¹Ïªí¼Æ¦C¤¤ X Ȫº°}¦C¡C ½Ð±N "»s¹Ïµ{§Ç()" ¤¤ .AxisGroup = 1 ªº¤U¤@¦C¼W¥[¤@¦æ¡G
.SeriesCollection(1).XValues = Range(Sh.Name & "!$A$" & CStr(StartKBarRow) & ":" & Sh.Name & "!$A$" & CStr(EndKBarRow))
¦p¤U©Ò¥Ü¡G
Private Sub »s¹Ïµ{§Ç(xlSh As String) ' ¥þ³¡«Ã¸
Dim Sh As Worksheet, xi As Integer
Set Sh = Sheets(xlSh)
Sh.ChartObjects.Delete
With Sh.ChartObjects.Add(Sh.Cells(sPos(1), sPos(2)).Left, Sh.Cells(sPos(1), sPos(2)).Top, sPos(3), sPos(4)).Chart
.ChartType = xlColumnClustered ' xlColumnStacked -> °ïÅ|ª½±ø¹Ï
.SetSourceData Source:=Chart_Source
.HasLegend = 0 ' ¹Ïªíªº¹Ï¨Ò: ¤£¥i¨£
.SeriesCollection(1).AxisGroup = 1
' 2012/7/22 ¥[¤J XValues ³]©w¹Ïªí¼Æ¦C¤¤ X Ȫº°}¦C¡C 쥻¥¼³]©w¬O¥H¼Æ¦C§Ç¸¹³B²z¡A¬G¤©¥H×¥¿¥H²Å¨Æ¹ê¡C
.SeriesCollection(1).XValues = Range(Sh.Name & "!$A$" & CStr(StartKBarRow) & ":" & Sh.Name & "!$A$" & CStr(EndKBarRow))
¦P®É±N StartKBarRow »P EndKBarRow ªºÅܼƫŧi±q DrawStatistics() ¤¤²¾¸m¤½¥ÎÅܼƫŧi°Ï¶ô¡C
Option Explicit
Dim sPos(1 To 4)
Dim xText As String
Dim Chart_Source As Variant
' ¦]©ó DrawStatistics() ¥H¤Î »s¹Ïµ{§Ç() ¨ç¦¡¤º§¡»Ý¨Ï¥Î¡A¬G±N¦¹¨âÅܼƧאּ¤½¥ÎÅܼÆ
Dim StartKBarRow, EndKBarRow As Long
¨ì¦¹§Ú·QÀ³¸Ó·~¤w¤j¥\§i¦¨¤F§a¡A¯¬©p¾Ç·~²r¶i¡I
P.S. ³Ì«á¦AÃØ°e¤@Ó¤p§ª« ("##.##" §ï¦¨¦p¤U¡A¾\Äý·|§ó©ú½T)¡G
.DataLabels.NumberFormat = "#0.##" |
|
|
|
|
|
|
- ©«¤l
- 33
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 37
- ÂI¦W
- 0
- §@·~¨t²Î
- w7
- ³nÅ骩¥»
- pro
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- ¨Ó¦Û
- ¥x¤¤
- µù¥U®É¶¡
- 2012-6-20
- ³Ì«áµn¿ý
- 2019-5-24
|
¦^´_ 30# c_c_lai
c_c_lai ¤jô ¹ï¤£°_ÁÙ没§¹¦¨³Ì²×¥Ø¼Ð,¥i¥H¬Ý¬Ý¦A²{¦b¶Çµ¹§AÀɮ׬O§Ún¥Îvba»yªk§¹¦¨ªº³Ì²×¥Ø¼Ð¾ãÓ¹Lµ{¦p¤U敍z
1 ¥ýªì©l¤ÀªRµ²ªGªí
2 ¦A°õ¦æoutline§P§O , ¦pªG¦X®æ´N°O¿ý"ok"¤£¦X®æ´N°O¿ý"ng"
3 ¦pªG¦³"ng"È¥h°£"ng"¸Ó¦C, §â"ok"¦Ccopy ¨ì¤U¤@¦¸ªí®æ°Ï¶¡¦A°õ¦æoutline§P§O,(¦]¬°¦C¼Æ(®a¼Æ)´î¤Ö,§P§OÈ·|§ïÅÜ)
4 ¤@ª½¨ì¥þ³¡³£"ok"®É³oÓªí®æ°Ï¶¡¬O§Ú¹Ïªí¸ê®Æªº¨Ó·½5 ³Ì«á¦A¼W¥[¤@ªí®æ°Ï¶¡(ºÙ¬°°õ¦æz_score)§â¥þ³¡¦C¼Æ(®a¼Æ)copy ¨ì³Ì«áªí®æ°Ï¶¡ (°õ¦æz_score)§@z_score§P§O
5 ¦A§¹¦¨³ø§i®Ñ
11C1.rar (47.98 KB)
|
|
|
|
|
|
|
- ©«¤l
- 33
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 37
- ÂI¦W
- 0
- §@·~¨t²Î
- w7
- ³nÅ骩¥»
- pro
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- ¨Ó¦Û
- ¥x¤¤
- µù¥U®É¶¡
- 2012-6-20
- ³Ì«áµn¿ý
- 2019-5-24
|
¦^´_ 30# c_c_lai
c_c_lai¤jô¥[¤J¤U¦C®É
. SeriesCollection(1).XValues = Range(Sh.Name & "!$A$" & CStr(StartKBarRow) & ":" & Sh.Name & "!$A$" & CStr(EndKBarRow))
·|¥X²{"°õ¦æ¶¥¬q¿ù»~'1004'range¤èªk('global'ª«¥ó¥¢±Ñ) |
|
|
|
|
|
|
- ©«¤l
- 33
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 37
- ÂI¦W
- 0
- §@·~¨t²Î
- w7
- ³nÅ骩¥»
- pro
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- ¨Ó¦Û
- ¥x¤¤
- µù¥U®É¶¡
- 2012-6-20
- ³Ì«áµn¿ý
- 2019-5-24
|
¦^´_ 30# c_c_lai
c_c_lai ¤jô, ì½Ì§Úªº°g½k.§Ú§âDim StartKBarRow, EndKBarRow As Long±q»s¹Ïµ{¦¡²¾°£«áµ{¦¡´N¯à¥¿½T°õ¦æ |
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-7-24 21:06 ½s¿è
¦^´_ 8# lamihsuen
ºô¶¦n¹³¦³°ÝÃD¡A¦³ªº¤º®e®Ú¥»¬Ý¤£¨ì°T®§¡A |
|
|
|
|
|
|
- ©«¤l
- 33
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 37
- ÂI¦W
- 0
- §@·~¨t²Î
- w7
- ³nÅ骩¥»
- pro
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- ¨Ó¦Û
- ¥x¤¤
- µù¥U®É¶¡
- 2012-6-20
- ³Ì«áµn¿ý
- 2019-5-24
|
c_c_lai ¤jô, ½Ð°Ý¦Cªí²Ä¤T¶¥H«á³£¤£¨£¤F,n¦p¦ó¥s¥X |
|
|
|
|
|
|
- ©«¤l
- 33
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 37
- ÂI¦W
- 0
- §@·~¨t²Î
- w7
- ³nÅ骩¥»
- pro
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- ¨Ó¦Û
- ¥x¤¤
- µù¥U®É¶¡
- 2012-6-20
- ³Ì«áµn¿ý
- 2019-5-24
|
¦^´_ 28# c_c_lai
c_c_lai ¤jô ½Ð°Ý¦p¦ó³]©wÅý¹Ïªí°Ï»Pø¹Ï°Ï©³³¡ªÅ¶¡¤j¤@ÂI,§Ú¥[¤J¤ô¥¶b¼ÐÃD®É³£·|»PÃþ§O¼ÐÅÒ«疉 |
|
|
|
|
|
|