|
Private Sub CommandButton1_Click() '''添加
With Sheets("出库记录表")
r = .Cells(Rows.Count, 1).End(xlUp).Row + 1
For i = 7 To 14
.Cells(r, i - 5) = Me.Controls("textbox" & i).Text
Next i
.Cells(r, 1) = r - 3
End With
End Sub
Private Sub CommandButton4_Click() '''新建
For i = 7 To 14
Me.Controls("textbox" & i).Text = ""
Next i
End Sub
Private Sub TextBox7_Change() '''输入日期生成单号
If TextBox7.Text = "" Then
TextBox8.Text = ""
Else
With Sheets("出库记录表")
m = Trim(.Cells(Rows.Count, 3).End(xlUp))
wh = Right(m, 3)
rq = Left(m, 8)
If rq = Format(Date, "yyyymmdd") Then
TextBox8.Text = Format(Date, "yyyymmdd") & Format(Val(wh) + 1, "000")
Else
TextBox8.Text = Format(Date, "yyyymmdd") & Format(1, "000")
End If
End With
End If
End Sub
|
|