AutoFilter / Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to print information within a certain range of dates only. Using the Auto Filter and recording a macro, what do i have to write to let the macro know to stop at the range window, let me input the range and keep on running the macro
I appreciate any help you can give me
Thanks
Lisa
 
Lisa,

What do you mean by "range window." The Autofilter has dropdowns with which
the user selects the desired records. Is that what you mean?

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

Lisa said:
I am trying to print information within a certain range of dates only.
Using the Auto Filter and recording a macro, what do i have to write to let
the macro know to stop at the range window, let me input the range and keep
on running the macro?
 
Why not use an input box where you type in the stop date, attach it to a
button from the forms toolbar.
I am assuming that the dates are in the first column with autofilter

Sub Date_Range()
Application.ScreenUpdating = False
UserVal = Application.InputBox("Enter Stop Date")
If UserVal = False Then
Exit Sub
Else
Selection.AutoFilter Field:=1, Criteria1:="<=" & UserVal,
Operator:=xlAnd
End If
Application.ScreenUpdating = True
End Sub

attach the macro to a button, click the button and type in the last date you
want to be included.


--

Regards,

Peo Sjoblom

Lisa said:
I am trying to print information within a certain range of dates only.
Using the Auto Filter and recording a macro, what do i have to write to let
the macro know to stop at the range window, let me input the range and keep
on running the macro?
 
Back
Top