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 Excel VBA - Printing Seperate Graphs

Dim grphs(1 to 5) as Range
Dim i as Long, rng as Range
with worksheets("Sheet2")
grphs(1) = .Range("A1:J12")
grphs(2) = .Range("K1:T12"
grphs(3) = .Range("A13:J24")
grphs(4) = .Range("K13:T24")
grphs(5) = .Range("A25:J36")
End With
for i = 1 to 5
if not intersect(ActiveCell,grphs(i)) is nothing then
set rng = grphs(i)
exit for
end if
Next
rng.Printout

--

Regards,
Tom Ogilvy

"Numan " wrote in message
...
Hi All,

I have six worksheets that go together to make my workbook,

Sheet 2 consists of 5 graphs, each one on a seperate page, the graphs
are populated by data on sheet 6.

Sheet 1 is my main menu

Sheets 3 - 5 will also be populated at a later date with graphs from
data on sheet 6.

What I would like to do is write code for a command button that will
allow me to print out the graph that is on that particular page not the
whole worksheet which is all I can do at the moment.

Can somebody please help?

Thanks

Numan


---
Message posted from http://www.ExcelForum.com/