|    | 
     60個のチェックボックスがあって、チェックを入れている時「記録用シート」の決まったセルに「レ」を入力するマクロを考えました。 
 
Private Sub CommandButton1_Click() 
 With Sheets("記録用シート") 
  Dim i As Integer 
  i=3 
  Do  
    i=i+1 
    If .Cells(i,1)="" Then Exit Do 
  Loop 
    .Cells(i,1).Value=TextBox1.Value 
    If CheckBox1.Value=True Then 
      .Cells(i,9).Value="レ" 
    Else  
      .Cells(i,9).Value="" 
    End If 
    If CheckBox2.Value=True Then 
      .Cells(i,10).Value="レ" 
    Else  
      .Cells(i,10).Value="" 
    End If 
           : 
    If CheckBox59.Value=True Then 
      .Cells(i,77).Value="レ" 
    Else  
      .Cells(i,77).Value="" 
    End If 
    If CheckBox60.Value=True Then 
      .Cells(i,78).Value="レ" 
    Else  
      .Cells(i,78).Value="" 
    End If 
  END With 
End Sub 
というように、各チェックボックスに対する処理を書いていたら、このような長いマクロになってしまいました。簡単に省略する方法は有りませんか? 
 | 
     
    
   |