Excel 輸出整理,初始值 + 間隔值 * 次數

[方案1] 比 [方案2] 效率好很多


With ShtXX
Mod_i = i Mod 10 '取得尾數
Sort_R1 = Stay + (All_Ball) * Mod_i
Sotr_C1 = (All_Ball - 1 + Stay) + (All_Ball) * Mod_i
'lLastCol
'[方案1]

lLastCol = 1 + 3 * (i \ 10) '初始值 + 間隔值 * 次數

'[方案2]

'lLastCol = .Cells(Sort_R1, Cells.Columns.Count).End(xlToLeft).Column

'橫式輸出
ShtXX.Range(.Cells(Sort_R1, lLastCol + 2), .Cells(Sotr_C1, lLastCol + 3)) = arrBall_Rng
'由大→小排序
Set XX_Rng = .Cells(Sort_R1, lLastCol + 2).CurrentRegion
XX_Rng.Cells(1, 2).Sort _
key1:=XX_Rng.Columns(2), Order1:=xlDescending, Header:=xlGuess
End With

留言

這個網誌中的熱門文章

歐姆龍 HEM-7600T 評價,購買心得分享(打臉文)

超任 三國志3代,登入武將金手指

年青人眼鏡評價(負評),辛酸血淚史分享文