Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Macro to fill in 1 of 10


Sorry, I did not know how to word that title. What I need is a macro that
will fill in 1, 2, 3,... of however many the user requires. If there are 10
copies required, then the first page would print out as 1 of 10, the second
as 2 of 10, etc. I also need to fill in the PPO number on each printed
sheet, (same for all of that set). I do this in word, but am unfamiliar with
how to do this in excel. In Word, I use an autoopen macro that pops up
messageboxes for data entry. It then sends to my default printer.

thanx,
Bryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Macro to fill in 1 of 10


Bryan, try the below macro. I am not sure in which cell do you have the PPO
number...I have mentioned that as cell B2. Change to suit your requirement.
Also I assume this is a one paged template which you are trying to print..Try
and feedback

Sub Macro1()
intCopies = InputBox("Number of copies to print")
varPPO = InputBox("Enter the PPO number")
Range("B2") = intPPO
For intTemp = 1 To intCopies
ActiveSheet.PageSetup.RightFooter = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Sorry, I did not know how to word that title. What I need is a macro that
will fill in 1, 2, 3,... of however many the user requires. If there are 10
copies required, then the first page would print out as 1 of 10, the second
as 2 of 10, etc. I also need to fill in the PPO number on each printed
sheet, (same for all of that set). I do this in word, but am unfamiliar with
how to do this in excel. In Word, I use an autoopen macro that pops up
messageboxes for data entry. It then sends to my default printer.

thanx,
Bryan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Macro to fill in 1 of 10


Thanks for the prompt reply Jacob! I have a couple of problems here.
1 - is this placed in the Sheet1 or ThisWorkbook? (There is only 1 sheet)
2 - Unless I've missed something, this never prompts the user for input. I
tried this in both of the above, but it just opened the sheet and that was
that.
3 - Can the 1 0f 10 be placed in a cell instead of the footer?

Thanx,
Bryan

"Jacob Skaria" wrote:

Bryan, try the below macro. I am not sure in which cell do you have the PPO
number...I have mentioned that as cell B2. Change to suit your requirement.
Also I assume this is a one paged template which you are trying to print..Try
and feedback

Sub Macro1()
intCopies = InputBox("Number of copies to print")
varPPO = InputBox("Enter the PPO number")
Range("B2") = intPPO
For intTemp = 1 To intCopies
ActiveSheet.PageSetup.RightFooter = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Sorry, I did not know how to word that title. What I need is a macro that
will fill in 1, 2, 3,... of however many the user requires. If there are 10
copies required, then the first page would print out as 1 of 10, the second
as 2 of 10, etc. I also need to fill in the PPO number on each printed
sheet, (same for all of that set). I do this in word, but am unfamiliar with
how to do this in excel. In Word, I use an autoopen macro that pops up
messageboxes for data entry. It then sends to my default printer.

thanx,
Bryan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Macro to fill in 1 of 10


Bryan

Set the Security level to low/medium in (Tools|Macro|Security). Open the
workbook. From workbook launch VBE using short-key Alt+F11. From menu
'Insert' a module and paste the below code. Save. Get back to Workbook. Run
macro from Tools|Macro|Run <selected macro()

Adjust the range Range("A10") where the page numbers are printed
Adjust the range Range("B2")

Sub Macro1()
intCopies = InputBox("Number of copies to print")
varPPO = InputBox("Enter the PPO number")
Range("B2") = varPPO
For intTemp = 1 To intCopies
Range("A10") = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Thanks for the prompt reply Jacob! I have a couple of problems here.
1 - is this placed in the Sheet1 or ThisWorkbook? (There is only 1 sheet)
2 - Unless I've missed something, this never prompts the user for input. I
tried this in both of the above, but it just opened the sheet and that was
that.
3 - Can the 1 0f 10 be placed in a cell instead of the footer?

Thanx,
Bryan

"Jacob Skaria" wrote:

Bryan, try the below macro. I am not sure in which cell do you have the PPO
number...I have mentioned that as cell B2. Change to suit your requirement.
Also I assume this is a one paged template which you are trying to print..Try
and feedback

Sub Macro1()
intCopies = InputBox("Number of copies to print")
varPPO = InputBox("Enter the PPO number")
Range("B2") = intPPO
For intTemp = 1 To intCopies
ActiveSheet.PageSetup.RightFooter = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Sorry, I did not know how to word that title. What I need is a macro that
will fill in 1, 2, 3,... of however many the user requires. If there are 10
copies required, then the first page would print out as 1 of 10, the second
as 2 of 10, etc. I also need to fill in the PPO number on each printed
sheet, (same for all of that set). I do this in word, but am unfamiliar with
how to do this in excel. In Word, I use an autoopen macro that pops up
messageboxes for data entry. It then sends to my default printer.

thanx,
Bryan

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Macro to fill in 1 of 10


Jacob,

Works great. Can this macro be made to run on open instead of manually
running it?

"Jacob Skaria" wrote:

Bryan

Set the Security level to low/medium in (Tools|Macro|Security). Open the
workbook. From workbook launch VBE using short-key Alt+F11. From menu
'Insert' a module and paste the below code. Save. Get back to Workbook. Run
macro from Tools|Macro|Run <selected macro()

Adjust the range Range("A10") where the page numbers are printed
Adjust the range Range("B2")

Sub Macro1()
intCopies = InputBox("Number of copies to print")
varPPO = InputBox("Enter the PPO number")
Range("B2") = varPPO
For intTemp = 1 To intCopies
Range("A10") = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Thanks for the prompt reply Jacob! I have a couple of problems here.
1 - is this placed in the Sheet1 or ThisWorkbook? (There is only 1 sheet)
2 - Unless I've missed something, this never prompts the user for input. I
tried this in both of the above, but it just opened the sheet and that was
that.
3 - Can the 1 0f 10 be placed in a cell instead of the footer?

Thanx,
Bryan

"Jacob Skaria" wrote:

Bryan, try the below macro. I am not sure in which cell do you have the PPO
number...I have mentioned that as cell B2. Change to suit your requirement.
Also I assume this is a one paged template which you are trying to print..Try
and feedback

Sub Macro1()
intCopies = InputBox("Number of copies to print")
varPPO = InputBox("Enter the PPO number")
Range("B2") = intPPO
For intTemp = 1 To intCopies
ActiveSheet.PageSetup.RightFooter = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Sorry, I did not know how to word that title. What I need is a macro that
will fill in 1, 2, 3,... of however many the user requires. If there are 10
copies required, then the first page would print out as 1 of 10, the second
as 2 of 10, etc. I also need to fill in the PPO number on each printed
sheet, (same for all of that set). I do this in word, but am unfamiliar with
how to do this in excel. In Word, I use an autoopen macro that pops up
messageboxes for data entry. It then sends to my default printer.

thanx,
Bryan



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Macro to fill in 1 of 10


Place that in Workbook_Open event...From VBE double click 'This Workbook and
paste the code and try

Private Sub Workbook_Open()
intCopies = InputBox("Number of copies to print")
If intCopies 0 Then
varPPO = InputBox("Enter the PPO number")
Range("B2") = varPPO
For intTemp = 1 To intCopies
Range("A10") = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Jacob,

Works great. Can this macro be made to run on open instead of manually
running it?

"Jacob Skaria" wrote:

Bryan

Set the Security level to low/medium in (Tools|Macro|Security). Open the
workbook. From workbook launch VBE using short-key Alt+F11. From menu
'Insert' a module and paste the below code. Save. Get back to Workbook. Run
macro from Tools|Macro|Run <selected macro()

Adjust the range Range("A10") where the page numbers are printed
Adjust the range Range("B2")

Sub Macro1()
intCopies = InputBox("Number of copies to print")
varPPO = InputBox("Enter the PPO number")
Range("B2") = varPPO
For intTemp = 1 To intCopies
Range("A10") = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Thanks for the prompt reply Jacob! I have a couple of problems here.
1 - is this placed in the Sheet1 or ThisWorkbook? (There is only 1 sheet)
2 - Unless I've missed something, this never prompts the user for input. I
tried this in both of the above, but it just opened the sheet and that was
that.
3 - Can the 1 0f 10 be placed in a cell instead of the footer?

Thanx,
Bryan

"Jacob Skaria" wrote:

Bryan, try the below macro. I am not sure in which cell do you have the PPO
number...I have mentioned that as cell B2. Change to suit your requirement.
Also I assume this is a one paged template which you are trying to print..Try
and feedback

Sub Macro1()
intCopies = InputBox("Number of copies to print")
varPPO = InputBox("Enter the PPO number")
Range("B2") = intPPO
For intTemp = 1 To intCopies
ActiveSheet.PageSetup.RightFooter = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Sorry, I did not know how to word that title. What I need is a macro that
will fill in 1, 2, 3,... of however many the user requires. If there are 10
copies required, then the first page would print out as 1 of 10, the second
as 2 of 10, etc. I also need to fill in the PPO number on each printed
sheet, (same for all of that set). I do this in word, but am unfamiliar with
how to do this in excel. In Word, I use an autoopen macro that pops up
messageboxes for data entry. It then sends to my default printer.

thanx,
Bryan

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Macro to fill in 1 of 10


Perfect!! Thank you!!

"Jacob Skaria" wrote:

Place that in Workbook_Open event...From VBE double click 'This Workbook and
paste the code and try

Private Sub Workbook_Open()
intCopies = InputBox("Number of copies to print")
If intCopies 0 Then
varPPO = InputBox("Enter the PPO number")
Range("B2") = varPPO
For intTemp = 1 To intCopies
Range("A10") = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Jacob,

Works great. Can this macro be made to run on open instead of manually
running it?

"Jacob Skaria" wrote:

Bryan

Set the Security level to low/medium in (Tools|Macro|Security). Open the
workbook. From workbook launch VBE using short-key Alt+F11. From menu
'Insert' a module and paste the below code. Save. Get back to Workbook. Run
macro from Tools|Macro|Run <selected macro()

Adjust the range Range("A10") where the page numbers are printed
Adjust the range Range("B2")

Sub Macro1()
intCopies = InputBox("Number of copies to print")
varPPO = InputBox("Enter the PPO number")
Range("B2") = varPPO
For intTemp = 1 To intCopies
Range("A10") = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Thanks for the prompt reply Jacob! I have a couple of problems here.
1 - is this placed in the Sheet1 or ThisWorkbook? (There is only 1 sheet)
2 - Unless I've missed something, this never prompts the user for input. I
tried this in both of the above, but it just opened the sheet and that was
that.
3 - Can the 1 0f 10 be placed in a cell instead of the footer?

Thanx,
Bryan

"Jacob Skaria" wrote:

Bryan, try the below macro. I am not sure in which cell do you have the PPO
number...I have mentioned that as cell B2. Change to suit your requirement.
Also I assume this is a one paged template which you are trying to print..Try
and feedback

Sub Macro1()
intCopies = InputBox("Number of copies to print")
varPPO = InputBox("Enter the PPO number")
Range("B2") = intPPO
For intTemp = 1 To intCopies
ActiveSheet.PageSetup.RightFooter = intTemp & " of " & intCopies
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Bryan" wrote:

Sorry, I did not know how to word that title. What I need is a macro that
will fill in 1, 2, 3,... of however many the user requires. If there are 10
copies required, then the first page would print out as 1 of 10, the second
as 2 of 10, etc. I also need to fill in the PPO number on each printed
sheet, (same for all of that set). I do this in word, but am unfamiliar with
how to do this in excel. In Word, I use an autoopen macro that pops up
messageboxes for data entry. It then sends to my default printer.

thanx,
Bryan

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
Macro Fill palups Excel Worksheet Functions 2 January 20th 10 04:55 AM
Fill Down Macro Lost in Excel Excel Discussion (Misc queries) 7 December 8th 08 10:24 PM
Fill Macro benb7760 Excel Programming 7 June 16th 05 10:21 PM
using a macro for a fill Bob Phillips[_6_] Excel Programming 3 July 6th 04 05:37 PM
Fill Macro Mike Fenton Excel Programming 1 August 9th 03 12:10 AM


All times are GMT +1. The time now is 03:55 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"