Jefferson2512
Board Regular
- Joined
- Sep 16, 2019
- Messages
- 53
can someone help me to loop this ?
Code:
Dim wks As Worksheet
Dim addnew As Range
Dim addup(15) As Double
Set wks = Sheet9
Set addnew = wks.Range("AG3").Offset(0, 0)
If ecYes.Value = True Then
addnew.Offset(0, 1).Value = ecYes.Caption
ElseIf ecNo.Value = True Then
addnew.Offset(0, 1).Value = ecNo.Caption
ElseIf ecNa.Value = True Then
addnew.Offset(0, 1).Value = ecNa.Caption
End If
If ecYes1.Value = True Then
addnew.Offset(0, 2).Value = ecYes1.Caption
ElseIf ecNo1.Value = True Then
addnew.Offset(0, 2).Value = ecNo1.Caption
ElseIf ecNa1.Value = True Then
addnew.Offset(0, 2).Value = ecNa1.Caption
End If
If ecYes2.Value = True Then
addnew.Offset(0, 3).Value = ecYes2.Caption
ElseIf ecNo2.Value = True Then
addnew.Offset(0, 3).Value = ecNo2.Caption
ElseIf ecNa2.Value = True Then
addnew.Offset(0, 3).Value = ecNa2.Caption
End If
If ecYes3.Value = True Then
addnew.Offset(0, 4).Value = ecYes3.Caption
ElseIf ecNo3.Value = True Then
addnew.Offset(0, 4).Value = ecNo3.Caption
ElseIf ecNa3.Value = True Then
addnew.Offset(0, 4).Value = ecNa3.Caption
End If
If ecYes4.Value = True Then
addnew.Offset(0, 5).Value = ecYes4.Caption
ElseIf ecNo4.Value = True Then
addnew.Offset(0, 5).Value = ecNo4.Caption
ElseIf ecNa4.Value = True Then
addnew.Offset(0, 5).Value = ecNa4.Caption
End If
If ecYes5.Value = True Then
addnew.Offset(0, 6).Value = ecYes5.Caption
ElseIf ecNo5.Value = True Then
addnew.Offset(0, 6).Value = ecNo5.Caption
ElseIf ecNa5.Value = True Then
addnew.Offset(0, 6).Value = ecNa5.Caption
End If
If ecYes6.Value = True Then
addnew.Offset(0, 7).Value = ecYes6.Caption
ElseIf ecNo6.Value = True Then
addnew.Offset(0, 7).Value = ecNo6.Caption
ElseIf ecNa6.Value = True Then
addnew.Offset(0, 7).Value = ecNa6.Caption
End If
If ecYes7.Value = True Then
addnew.Offset(0, 8).Value = ecYes7.Caption
ElseIf ecNo7.Value = True Then
addnew.Offset(0, 8).Value = ecNo7.Caption
ElseIf ecNa7.Value = True Then
addnew.Offset(0, 8).Value = ecNa7.Caption
End If
If ecYes8.Value = True Then
addnew.Offset(0, 9).Value = ecYes8.Caption
ElseIf ecNo8.Value = True Then
addnew.Offset(0, 9).Value = ecNo8.Caption
ElseIf ecNa8.Value = True Then
addnew.Offset(0, 9).Value = ecNa8.Caption
End If
If ecYes9.Value = True Then
addnew.Offset(0, 10).Value = ecYes9.Caption
ElseIf ecNo9.Value = True Then
addnew.Offset(0, 10).Value = ecNo9.Caption
ElseIf ecNa9.Value = True Then
addnew.Offset(0, 10).Value = ecNa9.Caption
End If
If ecYes10.Value = True Then
addnew.Offset(0, 11).Value = ecYes10.Caption
ElseIf ecNo10.Value = True Then
addnew.Offset(0, 11).Value = ecNo10.Caption
ElseIf ecNa10.Value = True Then
addnew.Offset(0, 11).Value = ecNa10.Caption
End If
If ecYes11.Value = True Then
addnew.Offset(0, 12).Value = ecYes11.Caption
ElseIf ecNo11.Value = True Then
addnew.Offset(0, 12).Value = ecNo11.Caption
ElseIf ecNa11.Value = True Then
addnew.Offset(0, 12).Value = ecNa11.Caption
End If
If ecYes.Value = True Then
addup(0) = 100
ElseIf ecNo.Value = True Then
addup(0) = 0
ElseIf ecNa.Value = True Then
addup(0) = 100
End If
If ecYes1.Value = True Then
addup(1) = 100
ElseIf ecNo1.Value = True Then
addup(1) = 0
ElseIf ecNa1.Value = True Then
addup(1) = 100
End If
If ecYes2.Value = True Then
addup(2) = 100
ElseIf ecNo2.Value = True Then
addup(2) = 0
ElseIf ecNa2.Value = True Then
addup(2) = 100
End If
If ecYes3.Value = True Then
addup(3) = 100
ElseIf ecNo3.Value = True Then
addup(3) = 0
ElseIf ecNa3.Value = True Then
addup(3) = 100
End If
If ecYes4.Value = True Then
addup(4) = 100
ElseIf ecNo4.Value = True Then
addup(4) = 0
ElseIf ecNa4.Value = True Then
addup(4) = 100
End If
If ecYes5.Value = True Then
addup(5) = 100
ElseIf ecNo5.Value = True Then
addup(5) = 0
ElseIf ecNa5.Value = True Then
addup(5) = 100
End If
If ecYes6.Value = True Then
addup(6) = 100
ElseIf ecNo6.Value = True Then
addup(6) = 0
ElseIf ecNa6.Value = True Then
addup(6) = 100
End If
If ecYes7.Value = True Then
addup(7) = 100
ElseIf ecNo7.Value = True Then
addup(7) = 0
ElseIf ecNa7.Value = True Then
addup(7) = 100
End If
If ecYes8.Value = True Then
addup(8) = 100
ElseIf ecNo8.Value = True Then
addup(8) = 0
ElseIf ecNa8.Value = True Then
addup(8) = 100
End If
If ecYes9.Value = True Then
addup(9) = 100
ElseIf ecNo9.Value = True Then
addup(9) = 0
ElseIf ecNa9.Value = True Then
addup(9) = 100
End If
If ecYes10.Value = True Then
addup(10) = 100
ElseIf ecNo10.Value = True Then
addup(10) = 0
ElseIf ecNa10.Value = True Then
addup(10) = 100
End If
If ecYes11.Value = True Then
addup(11) = 100
ElseIf ecNo11.Value = True Then
addup(11) = 0
ElseIf ecNa11.Value = True Then
addup(11) = 100
End If