Private Sub CommandButton1_Click() Call Vdate Call Clear Call Actuator End Sub Private Sub Actuator() On Error Resume Next Dim a Dim d1, d2 n = 0 r = 0 Do While Sheets("台账表").Cells(r+ 2, 2).Value <> "" d1 = Sheets("台账表").Cells(r+ 2, 3).Value d2 = TextBox1.Value If DateValue(d1) = DateValue(d2) Then a= a & Sheets("台账表").Cells(r + 2, 2).Value & "#" & "、" End If r = r + 1 Loop Sheets("报审").Range("D5:N5").Value = Left(a, Len(a) - 1) End Sub Private Sub Clear() Sheets("报审").Range("D5:N5").ClearContents End Sub Private Sub Vdate() If Not IsDate(TextBox1.Value) Then MsgBox "请输入正确日期格式,如:2017/01/01!" End End If End Sub
|