View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Auto Choosing Pages to Copy

maybe this idea will help. Selections are often NOT necessary.
Sub printif()
If Sheets("sheet11").Range("a1") < "" Then Sheets("sheet11").Printout
End Sub

--
Don Guillett
SalesAid Software

"Sam Fowler" wrote in message
...
Hi:

I have a large worksheet containing a lengthy report that
I need to further automate. I need to send this to
Acrobat and if I can get this to work it will save
massive amounts of time merging, etc the pdf file. I need
to be able to have a macro select another sheet,
determine which pages in that sheet have data, then copy
the sheet, select the original (master) sheet, find the
next empty section, and paste the copied data. All Pages
in all worksheets are sized alike and I have been able to
get the following code to select the data and print it ,
but I could sure use some help going forward.


Sheets("Estimated Parts").Select
Range("o129").Select
If ActiveCell < "" Then
ActiveWindow.SelectedSheets.PrintOut From:=5, To:=5,
Copies:=1
End If

Range("O99").Select
If ActiveCell < "" Then
ActiveWindow.SelectedSheets.PrintOut From:=4, To:=4,
Copies:=1
End If

Range("o69").Select
If ActiveCell < "" Then
ActiveWindow.SelectedSheets.PrintOut From:=3, To:=3,
Copies:=1
End If

Range("o39").Select
If ActiveCell < "" Then
ActiveWindow.SelectedSheets.PrintOut From:=2, To:=2,
Copies:=1
End If

Range("o9").Select
If ActiveCell < "" Then
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1,
Copies:=1
End If




Thanks in advance for your help,

Sam