| 
    
     |  | 良くわかんないですが・・・。 
 こんな方法もありかも・・・。
 
 ===================================================
 やりたい事はこんな感じなんだと思いました。
 
 行変数: i
 繰り返し定義
 26列が空白になる迄
 
 前提条件
 26列目を文字列変換した値がtori
 28列目を文字列変換した値が"1"
 18列目を文字列変換した値がnentuki
 27列目を文字列変換した値が"500"
 
 直条件
 17列目を文字列変換した値が"2"
 
 T: goke1 = goke1 - Cells(i, 11).Value
 i = i + 1
 F: goke1 = goke1 + Cells(i, 11).Value
 i = i + 1
 
 前提条件を満たさない場合
 繰り返しを終了
 
 ===================================================
 
 Dim Chk As Boolean
 
 
 Do While .Cells(1, 26).Value <> ""
 With Rows(i)
 Chk = CStr(.Cells(1, 26).Value) = tori
 Chk = Chk And CStr(.Cells(1, 28).Value) = "1"
 Chk = Chk And CStr(.Cells(1, 18).Value) = nentuki
 Chk = Chk And CStr(.Cells(1, 27).Value) = "500"
 
 If Chk Then
 goke1 = goke1 + (IIf(CStr(.Cells(1, 17).Value) = "2", -1 * Cells(i, 11).Value, Cells(i, 11).Value))
 i = i + 1
 Else
 Exit Do
 End If
 End With
 Loop
 
 |  |