Private Sub 添加项目_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then
If ListView1.Value = "" Then exit sub '目的是ListView1中无选项时,退出,,,但改成这样后,没有成功。。。
With Sheets("新录入表")
.Cells(Selection.Row, Selection.Column).Offset(0, 0) = ListView1.SelectedItem.Text
.Cells(Selection.Row, Selection.Column).Offset(0, 1) = ListView1.SelectedItem.SubItems(1)
.Cells(Selection.Row, Selection.Column).Offset(0, 2) = ListView1.SelectedItem.SubItems(2)
.Cells(Selection.Row, Selection.Column).Offset(0, 3) = ListView1.SelectedItem.SubItems(3)
.Cells(Selection.Row, Selection.Column).Offset(0, 4) = ListView1.SelectedItem.SubItems(4)
.Cells(Selection.Row, Selection.Column).Offset(0, 5) = Me.添加项目.Text
End With
Unload Me
End If
End Sub