我已经生成了这个代码来坐在属于用户窗体的按钮上......
Private Sub CommandButton1_Click()
Dim lngWriteRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
NextRow = Cells(Rows.Count, 2).End(xlUp).Row + 1
lngWriteRow = ws.Cells(Rows.Count, 2).End(xlUp) _
.Offset(12, 0).NextRow
ws.Range("B" & lngWriteRow) = TextBox1.Value
ws.Range("C" & lngWriteRow) = TextBox2.Value
ws.Range("D" & lngWriteRow) = TextBox3.Value
ws.Range("E" & lngWriteRow) = ComboBox1.Value
ws.Range("F" & lngWriteRow) = TextBox4.Value
ws.Range("G" & lngWriteRow) = ComboBox2.Value
End Sub
它不会自动移动到下一行,并且会覆盖第 14 行,当我希望它在 14 中有数据时更新 15,然后当 15 有数据时,更新 16 等等...
有任何想法吗?