Sub testFast()
Dim DataRange As Variant
Dim Irow As Long
Dim Icol As Integer
Dim MyVar As Double
DataRange = Range("O12").CurrentRegion '將所需資料存入 陣列DataRange
DataRangeRowsCount = Range("O12").CurrentRegion.Rows.Count ' 陣列DataRange 的行數
For Irow = 3 To DataRangeRowsCount '存入陣列/數組時,包括了兩行標題,故由3開始
StaffName = "'" & Right("00" & DataRange(Irow, 1), 5)
StaffEvaCount = DataRange(Irow, 2)
StaffScore = Round((DataRange(Irow, 3) + DataRange(Irow, 4) + DataRange(Irow, 5) + DataRange(Irow, 6) + DataRange(Irow, 7)) / 5, 2)
Next Irow
End Sub
沒有留言:
張貼留言