|
ponponです。こちらに変えてください。
""で囲むとTextBox1.Textで検索します。
Private Sub CommandButton1_Click()
Dim Adate As String
Dim Bdate As String
Dim myName As String
Adate = Me.TextBox1.Text
Bdate = Me.TextBox2.Text
myName = TextBox3.Text
Worksheets("sheet3").Range("A1").CurrentRegion.ClearContents
With Worksheets("sheet2")
.Range("A1").CurrentRegion.AutoFilter Field:=1, Criteria1:=">=" & Adate, Operator:=xlAnd, _
Criteria2:="<=" & Bdate
.Range("A1").CurrentRegion.AutoFilter Field:=2, Criteria1:=myName
.Range("A1").CurrentRegion.Copy
Worksheets("sheet3").Range("A1").PasteSpecial
Range("A1").CurrentRegion.AutoFilter
Application.CutCopyMode = False
End With
End Sub
|
|