View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default print a certain range depending what is in cell?

for i = 1 to 5
ActiveSheet.Range("A1").CurrentRegion _
.Autofilter Field1:=1, Criteria1:=i
Activesheet.Printout
Next i


--
Regards,
Tom Ogilvy


"Momo" wrote in message
...
hello,

I have completed phase one of my macro and am now on phase two, this
requires me to print a specific range from a spreadsheet.

If i had in a spreadsheet dat which lets say is a total of 200 lines, in
column A each line will either display a number from 1 to 5, and they will

be
in order, i.e. first 50 rows are the 1s, then the 2s etc. i dont know how
many of each number there are and i want my macro to look and i print each
set in turn, i.e for 1 it will identify where the first row containing a

one
is and the last row containing a 1 (all in column A) and thus will give me

a
range,

Any help please,

thanks

andy