標題:
幫忙Debug
[打印本頁]
作者:
JeNXiU
時間:
2014-4-7 23:32
標題:
幫忙Debug
本帖最後由 GBKEE 於 2014-4-8 09:28 編輯
如題,有高手可以幫忙嘛
作者:
GBKEE
時間:
2014-4-8 08:47
本帖最後由 GBKEE 於 2014-4-9 05:56 編輯
回復
1#
JeNXiU
If Cells(K2, 26) - 1 = 0 Then
GoTo 1
Else
'建議-> For K2 = 1+1 To 11 + 1
If K2 = 1 Then MsgBox Cells(K2 - 1, 26).Address '當 K2 = 1 -> K2 - 1 = 0
Dim Rng As Range
Set Rng = Range(Cells(Cells(K2 - 1, 26) + 1, 10), Cells(Cells(K2, 26), 10)) '設定範圍(修改為你要的範圍)
MsgBox Rng.Address
'With Sheets("主頁").Cells(3 * K2 - 2 + K1, 3)
With Sheets("主頁").Cells(3 * (K2 - 1) - 2 + K1, 3) '建議修改為你要的範圍
.Value = Application.WorksheetFunction.Average(Rng)
'Sheets("主頁").Cells(3 * K2 - 2 + K1, 4) = Application.WorksheetFunction.Max(Rng)
.Offset(, 4) = Application.Max(Rng)
'Sheets("主頁").Cells(3 * K2 - 2 + K1, 5) = Application.WorksheetFunction.Min(Rng)
.Offset(, 5) = Application.Min(Rng)
'Sheets("主頁").Cells(3 * K2 - 2 + K1, 6) = Application.WorksheetFunction.Percentile(Rng, 0)
.Offset(, 6) = Application.Percentile(Rng, 0)
'Sheets("主頁").Cells(3 * K2 - 2 + K1, 7) = Application.WorksheetFunction.Percentile(Rng, 0.25) - Application.WorksheetFunction.Percentile(Rng, 0.1)
.Offset(, 7) = Application.Percentile(Rng, 0.25) - Application.Percentile(Rng, 0.1)
'Sheets("主頁").Cells(3 * K2 - 2 + K1, 8) = Application.WorksheetFunction.Percentile(Rng, 0.5) - Application.WorksheetFunction.Percentile(Rng, 0.25)
.Offset(, 8) = Application.Percentile(Rng, 0.5) - Application.Percentile(Rng, 0.25)
'Sheets("主頁").Cells(3 * K2 - 2 + K1, 9) = Application.WorksheetFunction.Percentile(Rng, 0.75) - Application.WorksheetFunction.Percentile(Rng, 0.5)
.Offset(, 9) = Application.Percentile(Rng, 0.75) - Application.Percentile(Rng, 0.5)
'Sheets("主頁").Cells(3 * K2 - 2 + K1, 10) = Application.WorksheetFunction.Percentile(Rng, 0.9) - Application.WorksheetFunction.Percentile(Rng, 0.75)
.Offset(, 10) = Application.Percentile(Rng, 0.9) - Application.Percentile(Rng, 0.75)
End With
End If
複製代碼
作者:
JeNXiU
時間:
2014-4-8 21:50
回復
2#
GBKEE
感謝G大指教 小弟先試試
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)