|
もう1ヶ所
Cells(co1 + 2, 17) = Me.Controls("label" & co1).Caption
此れに至っては、同じ値を400回代入している様ですね?
Testして居ないので、上手くいくか?ですが
以下で同じ動きをすると思います?
Dim i As Long
Dim lngRow As Long
Dim lngColumn As Long
Dim vntResult1(1 To 40, 1 To 10) As Variant
Dim vntResult2(1 To 40, 1 To 1) As Variant
For i = 1 To 400
lngRow = (i - 1) \ 10 + 1
lngColumn = (i - 1) Mod 10 + 1
If Me.Controls("CheckBox" & i).Value Then
vntResult1(lngRow, lngColumn) = "○"
Else
vntResult1(lngRow, lngColumn) = "×"
End If
Next i
For i = 1 To 40
vntResult2(i, 1) _
= Me.Controls("Label" & i).Caption
Next i
With Worksheets(Mys)
Select Case Me.Controls("combobox2").Value
Case "4月"
lngColumn = 0
Case "5月"
lngColumn = 12
Case "6月"
lngColumn = 24
End Select
.Cells(3, 1 + lngColumn) _
.Resize(UBound(vntResult1, 1), _
UBound(vntResult1, 2)).Value = vntResult1
.Cells(3, 17 + lngColumn) _
.Resize(UBound(vntResult2, 1)).Value = vntResult2
End With
|
|