請問一下做統計莖葉圖在excel時,有程式可設定嗎?
還是就自己打的莖的數字及葉的數字呢??
謝謝 ~~~
2006-11-02 05:36:42 · 1 個解答 · 發問者 小果 1 in 電腦與網際網路 ➔ 軟體
巨集 Part II部分
ii = 1
For i = 1 To iRange
iStem(i) = i + imin - 1
Stem(i) = Str(iStem(i))
Do While iStem(i) = Int(SLData(ii))
TempStr = Str(Int(10 * (SLData(ii) - Int(SLData(ii)) + 0.0000005) + 0.5))
If TempStr = " 10" Then
Leaf(i + 1) = Leaf(i + 1) + " 0"
If (i + 1) > iRange Then
ExtraRange = True
Stem(iRange + 1) = Str(i + imin)
End If
Else
Leaf(i) = Leaf(i) + TempStr
End If
ii = ii + 1
If ii > Items Then
Exit Do
End If
Loop
Next i
Set SLSheet = Sheets("Stem-and-Leaf")
SLSheet.Cells.Delete Shift:=xlUp
If ExtraRange Then
iRows = iRange + 1
Else
iRows = iRange
End If
For i = 1 To iRows
SLSheet.Cells(i + 4, 4) = Stem(i)
SLSheet.Cells(i + 4, 5).NumberFormat = "@"
SLSheet.Cells(i + 4, 5) = Leaf(i)
Next i
With SLSheet.Range("D5").CurrentRegion
.Font.Bold = True
With .Columns(1)
.Borders(xlLeft).LineStyle = xlNone
With .Borders(xlRight)
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
.Borders(xlTop).LineStyle = xlNone
.Borders(xlBottom).LineStyle = xlNone
.BorderAround LineStyle:=xlNone
End With
End With
SLSheet.Select: SLSheet.Range("A1").Select
MsgBox "All Done!"
End Sub
2006-11-06 10:36:38 · answer #1 · answered by ? 4 · 0⤊ 0⤋