print a certain range depending what is in cell?

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

Guest

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
 
for i = 1 to 5
ActiveSheet.Range("A1").CurrentRegion _
.Autofilter Field1:=1, Criteria1:=i
Activesheet.Printout
Next i
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top