|
楼主 |
发表于 2018-9-2 20:55
|
显示全部楼层
Private Sub CommandButton1_Click()
If Sheets("输入栏").Cells(7, 4) <> "" Then
Dim a As Long
a = Sheets("输入栏").[d26].End(xlUp).Row
Sheets("输入栏").Range("A7:i" & a).Select
Selection.Copy
Dim b As Long
b = Sheets("数据库").[a65536].End(xlUp).Row + 1
Sheets("数据库").Select
Sheets("数据库").Cells(a, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("输入栏").Range("c7:c18").ClearContents
Sheets("输入栏").Range("g7:i18").ClearContents
Sheets("输入栏").Select
Sheets("输入栏").Cells(7, 2).Select
Else
MsgBox "请输入货号、数量、生产日期"
End If
End Sub
这个写出来数据库里,行不对应 |
|