View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Setting Print Area

Sub Macro1()
For i = 1 To Rows.Count
If Cells(i, "G").Value 200 Then
Exit For
End If
Next
i = i - 1
ActiveSheet.PageSetup.PrintArea = "$A$1:$Q$" & i
End Sub

This assumes that your 17 columns are columns A thru Q

--
Gary''s Student - gsnu200828


"DavidH56" wrote:

Hello,

I am using Excel 2003. I would appreciate it greatly if someone could
assist me with a macro to set my print area. I have 17 columns (with 16
being visible) full of data and varying rows each time that my report is
created. I have sorted on column 3 (increasing) as this column contains any
number from 0 to 3000 or more. I would like the code to set and limit the
print area to rows to include integers 0 to 200. Anything 200 is not to be
included in the print area. I have a header also.

Thanks for any assistance that you can provide.
--
By persisting in your path, though you forfeit the little, you gain the
great.