autofilter

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

Guest

When I run autofilter using a macro and then print preview (or print) the titles are gone. I've checked print ranges and I have them correct. Any suggestions?
 
Hi
you may post your current macro for analysing it :-)

--
Regards
Frank Kabel
Frankfurt, Germany

Louise said:
When I run autofilter using a macro and then print preview (or
print) the titles are gone. I've checked print ranges and I have them
correct. Any suggestions?
 
Here it is. I appreciate you looking it over. The Cell A21 is where the data that needs to be filter begins

----------------------------------------

ApplicationScreenUpdating = Fals
Sheets("Data").Selec
Range("A21").Select
Title1= "START
Title2 = "END
Prompt1 = "Please enter Starting Date
Prompt2 = "Please enter Ending Date"
UserVal = Application.InputBox(Prompt1
If UserVal = False The
Exit Su
Els

UserVal2 = Application.InputBox(Prompt2
If UserVal2 = False The
Exit Su
Els
Selection.AutoFilter Field:=1, Criteria1:=">=" & UserVal, Operator:=xlAnd
, Criteria2:="<=" & UserVal
End I
End I

ActiveWindow.SelectedSheets.PrintPrevie
Selection.AutoFilte
Sheets("Main Page").Selec
Range("A1").Selec
ApplicationScreenUpdating = Tru
End Sub
 
Revised. I forgot to incl. Title1 & Title
------------------------------------------------------------------------
ApplicationScreenUpdating = Fals
Sheets("Data").Selec
Range("A21").Select
Title1= "START
Title2 = "END
Prompt1 = "Please enter Starting Date
Prompt2 = "Please enter Ending Date"
UserVal = Application.InputBox(Prompt1,Title1
If UserVal = False The
Exit Su
Els

UserVal2 = Application.InputBox(Prompt2,Title2
If UserVal2 = False The
Exit Su
Els
Selection.AutoFilter Field:=1, Criteria1:=">=" & UserVal, Operator:=xlAnd
, Criteria2:="<=" & UserVal
End I
End I

ActiveWindow.SelectedSheets.PrintPrevie
Selection.AutoFilte
Sheets("Main Page").Selec
Range("A1").Selec
ApplicationScreenUpdating = Tru
End Sub
 
Back
Top