Printing the next page? help!!

mcfly

Board Regular
Joined
May 15, 2002
Messages
162
I am using the 1st sheet in my workbook as an entry sheet called ("entry"), on the following 13 sheets I have it to where if, say sheet1 (which is actually the second sheet) has info in it from the entry in the "entry" sheet, sheet1! cell "AQ11" diplays a 1 there. This is the only thing that would make since to do [=if(sheet1!aq11=1, 'my print range')], but I can't quite put my finger on a code. I have been trying for about 3 or 4 months ever since my last "new topic" was placed on the board(which was about this same problem). I have been searching and searching and thought I found some solutions but they keep displaying the 1st page(entry"), and I don't what the code to even recognize the 1st page ever. I hope there is somebody that can help me on this!!!!!!!!!

Thanks in advance for the help!!!!!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

mcfly

Board Regular
Joined
May 15, 2002
Messages
162
Please help me before I go insane!!



I might already be there. ?
 
L

Legacy 7259

Guest
Can't understand your explanation of what you're trying to do.
 

mcfly

Board Regular
Joined
May 15, 2002
Messages
162
I am trying to only print the sheets after sheet 1.

I am using sheet 1 as an entry screen. And sheets 2 thru 14 are all linked together so that whenever I enter data into sheet1 it fills in the other sheets if it meets that criteria.
EX: I enter 15000 into the Medium box and it fills out sheet2 thru sheet3, but if I enter 25000 it fills out sheets2 thru sheet4 and so on.

My problem is that I can only print out the sheet that is selected and not the other sheets. I want to be able to just hit print and it prints out the sheets that meet that criteria.
Thanks in advance.
 

Jim North

MrExcel MVP
Joined
Jun 20, 2002
Messages
791

ADVERTISEMENT

You would probably need to set up a button for it, but this:

PrintOut Method Example

This example prints the active sheet.

ActiveSheet.PrintOut

... should be a starting point for you. Try searching the board for PRINTOUT
 

Ivan F Moala

MrExcel MVP
Joined
Feb 10, 2002
Messages
4,209
Jim is correct

Follow what he has said as a starting point.
ie. you will need code for this.

What you will need is to check your crieria for the sheets that you want printed out and act on this. Post back if you have problems.
But in general if you are coding this plan out the actual steps you would take to do this manually bearing in mind that it is the criteria that you need to have correct/setup
 

sreeder

New Member
Joined
Aug 27, 2002
Messages
12

ADVERTISEMENT

Mclfy,
Do you want to print all tabs starting with tab3 or various depending on criteria in tab2 (Sheet1)?
 

mcfly

Board Regular
Joined
May 15, 2002
Messages
162
Thanks for the replies EVERYONE, but I think I just finished with this thing, I had to insert a userform and use a listbox in it and insert the following code that I found on John Wakenbachs CD 'Excel 2000 power programming with VBA', I had to make some changes but it seems to work great.

Private Sub UserForm_Initialize()
For Each sht In ActiveWorkbook.Worksheets
ListBox1.AddItem sht.Name
Next sht
UserForm1.Height = 128
End Sub
Private Sub OptionsButton_Click()
If OptionsButton.Caption = "Options >>" Then
UserForm1.Height = 164
OptionsButton.Caption = "<< Options"
Else
UserForm1.Height = 128
OptionsButton.Caption = "Options >>"
End If
End Sub
Private Sub CancelButton_Click()
Unload Me
End Sub

Private Sub OKButton_Click()
MsgBox "Sheets will now be printed."
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
With Sheets(ListBox1.List(i))
.PageSetup.PrintGridlines = cbGridlines
If obLandscape Then .PageSetup.Orientation = xlLandscape
If obportrait Then .PageSetup.Orientation = xlPortrait
.PrintOut
End With
End If
Next i
Unload Me
End Sub

THANKS FOR ALL THE HELP AND ADVICE!!!! I hope this helps out somebody else, cause this was starting to become a nightmare.
 

Joe Was

MrExcel MVP
Joined
Feb 19, 2002
Messages
7,539
Right click the sheet you want your Form Print Button on and select "View Code." Then from the toolbar of the editor (you will be in it) select "Insert-Module" then paste a copy of the code below into the module.

Change the sheet names in the code to your sheet names add as many code blocks as you need. Hit the top close "X" to return to the sheet. From the Excel toolbar select "View-Toolbars-Forms" click on the button icon. Drag the size button you want on the sheet. It will ask you for the macro name to use with your button. Select the sub's name.

Right click the button, at the rear of the button caption (lable), back space the caption out. Right click the button, select "Format Control." Select font bold, pick a color, hit OK. Type your new caption for the button, click any cell.

Now when you hit your new print button each sheet that you have coded will print.

Note: You must set the "Print Area" for each sheet, then do a page setup for each page as well. Excel will remember each page print format for you. This is the fastest print code. JSW

Sub myPrint()
'Each block prints one sheets pages.

Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Sheets("Sheet4").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub


_________________<INPUT type="JSW" value=" Excel On... Coder's!" ID=Text1><spanstyle='font-size:36.0pt;color:#FFCC00'>JSW<o:p></o:p></span>[/b]</p><spanstyle='font-size:36.0pt;color:#FFCC00'>Try and try again, " The way of the coder!"<o:p></o:p></span>[/b]
This message was edited by Joe Was on 2002-09-06 17:27
 

Forum statistics

Threads
1,147,673
Messages
5,742,530
Members
423,736
Latest member
dracula cyrus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top