Private Sub CommandButton2_Click()
On Error Resume Next
If Len(ListBox3) > 0 Then ' 如果文字框有文字
Sheets("防潮板").Select
Sheets("防潮板").[h1] = ListBox3.Text
If WorksheetFunction.CountIf(Sheets("防潮板").Range("H:H"), [h1].Value) < 2 Then
Sheets("sheet1").Select
UserForm1.Show 0
UserForm1.ListBox3 = ""
Else
[h1].Select
Sheets("防潮板").Cells.Find(What:=[h1], After:=ActiveCell).Activate
ActiveCell.Offset(0, 1).Select
ActiveCell.EntireRow.Select
Selection.Copy
Sheets("Sheet1").Select
Selection.Insert Shift:=xlUp
Call CycleThrough
End If
End If
End Sub通过这个将对应的整行复制过来