Print Area Question

  • Thread starter Thread starter Will Francis
  • Start date Start date
W

Will Francis

Hi Folks

I am looking for a piece of code which will enable me to
print a selection, the selection being cells selected by
AutoFiltering cells.

At the moment I have code which filters cells, how do I
then set this range as the print area?

Any help appreciated.

Thanks
Will
 
Hi,


Only the visible cells (filtered data will be printed
when you just do..

ActiveWindow.SelectedSheets.PrintOut Copies:=1

Abdul Salam
 
Thanks for that Abdul.

However, when I use the code, I get lots of blank lines
appearing after the filtered data (my sheet has formatting
which extends far beyond the end of the filtered data).

Ideally, I am looking to get the filtered data onto 1 page
if possible.

Thanks
Will
 
With ActiveSheet.PageSetup
.PrintArea = _
ActiveSheet.Autofilter.Range.Address(True,True,xlA1,True)
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Activesheet.Printout
 
Back
Top