|
ありがとうございました。
少しいじって、下記コードで上手くいきました。
たすかりました。
Private Sub 入力(Ws As String, Co1 As Long)
Dim Cou As Long, i As Long, Co As Long
With Worksheets("用紙")
For i = 2 To 43
Select Case i
Case 2 To 8: Cou = 11: Co = 0
Case 9 To 15: Cou = 13: Co = -7
Case 16 To 22: Cou = 15: Co = -14
Case 23 To 29: Cou = 17: Co = -21
Case 30 To 36: Cou = 19: Co = -28
Case 37 To 43: Cou = 21: Co = -35
End Select
.Cells(Cou, i + Co).Value = Me.Controls("TextBox" & i + Co1).Value
.Cells(Cou - 1, i + Co).Value = Me.Controls("label" & i + 41).Caption
Next i
End With
End Sub
|
|