Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Auto Choosing Pages to Copy

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



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





  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Auto Choosing Pages to Copy

Hi Don:

Thanks for your reply.

I'm not sure I was clear enough about what I really need
to do with this macro, let me add this. Hopefully you can
shed a bit of light on this.

as for the ranges, the worksheet has 10 pages, each is 30
rows, with the first data entry cell in each sheet, being
the 9th cell, ie : a9, a39, a69, etc... The pages are all
formatted with logos, disclosures, etc and I never know
if I will have enough data for 1 page, 10 pages, or no
pages .If that first cell on each page has data in it, I
need to copy that entire page, formatting as well. Then I
need to select the actual report worksheet, "INV", find
the last cell with data, then select the next cell in
column A and paste the entire page, or pages. I then need
to run this several more times for another worksheet
containing the same types of data..and put those non
empty pages after the first set. The Pages from each
worksheet may be as many as 10, or as few as 0, depending
on whether or not there is any data of that particular
type...and all pages in these other worksheets are also
the same size.

Thanks,

Sam

-----Original Message-----
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





.

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
Auto-populate, Auto-copy or Auto-fill? Jay S. Excel Worksheet Functions 4 August 10th 07 09:04 PM
how do i auto number pages in excel p Excel Discussion (Misc queries) 1 February 18th 07 09:41 PM
Auto Number Several Pages Gladys Excel Discussion (Misc queries) 1 January 11th 07 04:33 PM
Auto Fill Cells, When Choosing From Drop-Down List... doc1975 Excel Worksheet Functions 1 January 11th 06 02:36 AM
How do I remove the auto border from my printed pages in Excel GE Excel Discussion (Misc queries) 1 August 12th 05 01:37 AM


All times are GMT +1. The time now is 04:31 PM.

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

About Us

"It's about Microsoft Excel"