EXCEL VBA 完全なびごろく(笑) 行の数値を合計する。
Option Explicit Private Function plngOmomi(ByVal intRow As Integer) As Double Dim intCol As Integer Dim lngSum As Double lngSum = 0 For intCol = 3 To 43 If Cells(intRow, intCol) = "" Then Else lngSum = lngSum + CDbl(Cells(2, intCol)) End If Next plngOmomi = lngSum End Function Public Sub GetOmomi() Dim intRow As Integer For intRow = 6 To 107 Cells(intRow, 45) = plngOmomi(intRow) Next End Sub