返回列表 上一主題 發帖

[發問] [請各位大大幫忙] VBA input 表格製作

[發問] [請各位大大幫忙] VBA input 表格製作

本帖最後由 myfbee 於 2017-3-6 21:49 編輯

想寫段VBA,做成下圖的效果,感謝萬分!!!
HELLO

回復 1# myfbee


    Private Sub CommandButton1_Click()
Dim row As Integer
Dim col As Integer
Dim count1 As Integer

For count1 = 1 To 10
    For row = 1 To 100
        For col = 5 To 100
            str1 = "Input " & count1
            If (Cells(row, col) = str1) Then
                For number1 = 1 To Cells(row + 5, col + 2)
                    startrow = Range("A3").End(xlDown).row + 1
                    Cells(startrow, 1) = Cells(row + 2, col + 2)
                    Cells(startrow, 2) = Cells(row + 3, col + 2)
                    Cells(startrow, 3) = Cells(row + 4, col + 2)
                    Cells(startrow, 4) = number1
                Next
            End If
        Next
    Next
Next

End Sub

TOP

        靜思自在 : 【時日莫空過】一個人在世間做了多少事,就等於壽命有多長。因此必須與時間競爭,切莫使時日空過。
返回列表 上一主題