longytravel
Board Regular
- Joined
- Aug 2, 2011
- Messages
- 68
I have the following code (kindly produced by Weaver)
I want to design a user form (userform2) that has two text boxes to add two dates - i want to pull the information from those two dates
How do i get the dates inputted by the user into the code?
As ever - grateful for your views
I want to design a user form (userform2) that has two text boxes to add two dates - i want to pull the information from those two dates
How do i get the dates inputted by the user into the code?
As ever - grateful for your views
Code:
Sub Macro1()
date1 = "01 jan 2010"
date2 = "01 jan 2011"
With Sheets("data")
lr = .Cells(Rows.Count, "B").End(xlUp).Row
With .Range("B1")
.AutoFilter
.AutoFilter Field:=2, Criteria1:=">=" & date1, Operator:=xlAnd _
, Criteria2:="<=" & date2
End With
.Range("B1:B" & lr).EntireRow.Copy Sheets("reports").Range("A1")
End With
End Sub