|
- Private Sub CommandButton1_Click()
- Dim rg As Range
- Dim arr
- On Error Resume Next
- If Len(Me.TextBox1) Then
- Set rg = Range("a:a").Find(what:=Me.TextBox1, lookat:=xlWhole)
- If rg Is Nothing Then
- MsgBox "单号 " & Me.TextBox1.Value & " 有误"
- Else
- With rg
- arr = .Resize(, 8).Value
- .EntireRow.Delete
- Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(, UBound(arr, 2)).Value = arr
- End With
- End If
- Else
- MsgBox "请输入单号后再进行操作"
- End If
- Me.TextBox1.Value = ""
- Me.TextBox1.SetFocus
- End Sub
复制代码 |
|