Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default print a certain range depending what is in cell?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
updating cell range depending on input value handicapper Excel Worksheet Functions 3 April 17th 10 05:50 AM
How do I reference a range of cells depending on another cell valu batkinson Excel Discussion (Misc queries) 1 January 8th 08 09:58 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
Conditional formatting depending a range of cell Marisa Excel Worksheet Functions 2 November 1st 05 01:31 AM
Setting print area depending on a cell value Rick_Wendt Excel Programming 3 October 21st 04 06:59 PM


All times are GMT +1. The time now is 02:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"