看板 jaschiang
作者 標題 [Excel] 學以致用,記帳小程式!
時間 2010年12月31日 Fri. AM 02:12:42
Public Sub fn()
For i = 2 To 65535
If Cells(i, 3).Value = "早餐" Then
breakfast = Cells(i, 2) + breakfast
ElseIf Cells(i, 3).Value = "午餐" Then
lunch = Cells(i, 2) + lunch
ElseIf Cells(i, 3).Value = "晚餐" Then
dinner = Cells(i, 2) + dinner
ElseIf Cells(i, 3).Value = "悠遊卡" Then
easycard = Cells(i, 2) + easycard
ElseIf Cells(i, 3).Value = "咖啡" Then
cafe = Cells(i, 2) + cafe
ElseIf Cells(i, 3).Value = "菸" Then
smoke = Cells(i, 2) + smoke
ElseIf Cells(i, 3).Value = "飲料" Then
drink = Cells(i, 2) + drink
ElseIf Cells(i, 3).Value = "漫畫" Then
comics = Cells(i, 2) + comics
Else
others = Cells(i, 2) + others
End If
Next [i]
Cells(2, 6) = breakfast
Cells(3, 6) = lunch
Cells(4, 6) = dinner
Cells(5, 6) = easycard
Cells(6, 6) = cafe
Cells(7, 6) = smoke
Cells(8, 6) = drink
Cells(9, 6) = comics
Cells(10, 6) = others
End Sub
--
※ 作者: alljerry04 時間: 2010-12-31 02:12:42 來自: alljerry04.twbbs.org
※ 看板: jaschiang 文章推薦值: 0 目前人氣: 0 累積人氣: 246
回列表(←)
分享