I have found a macro which disables all print features in excel. I have rwo other codes to print. When I put this macro, It also disables the print from the other macro. How can I use this code so that normal print features will be disabled but if someone takes the print from the macros, Print will be allowed. The code which disables the print is given below:
Private Sub Workbook_BeforePrint(Cancel As Boolean) If PrtOK Then Cancel = False Else MsgBox "Can't print from here!" Cancel = True End If End Sub
I have a spreadsheet with a print button which allows the user to print only the parts I want them to see. I have removed the Printer icon on the toolbar, but does anyone know how to remove the Print option on the File menu? (File/Print)
Private Sub Workbook_BeforePrint(Cancel As Boolean) If IsEmpty(Range("A2,H2,P2")) Then Cancel = True End If End Sub
This code works for A2 but I can't get it to work for H2 or P2. i.e. print will be enabled if A2 has content and disabled if all three cells are blank, but if A2 is empty and H2 has content print will remain disabled.
I have a macro to print selected worksheets. It works well with one small problem. Whether I select the last worksheet or not, it always prints. I have tried a bunch of different ways to get around this, and all I succeeded in doing was getting a separate page printed first, then it would print the rest of my selection.
Sub PrintReportSelection() Sheets("Actual").Select Application.Goto Reference:="Actualprint" ActiveSheet.PageSetup.PrintArea = "Actualprint" Sheets("Deposits").Select Application.Goto Reference:="Depositsprint" ActiveSheet.PageSetup.PrintArea = "Depositsprint" Sheets("Debt").Select Application.Goto Reference:="Debtprint" ActiveSheet.PageSetup.PrintArea = "Debtprint" If Range("SelectVariance") = True Then Sheets("Variance").Select.........................
I'm using VBA code to select several worksheets at once, and print them. The code runs fine, but the result is multiple print jobs, not one job. This is OK when printing to the printer...but undesireable if you want to print to a pdf file, for example.
I've searched the site and found some references to this possibly being an excel problem. Is that true?
I've also checked the page setup setting to make sure that the print resolutions are all the same...that doesn't appear to be the problem either.
I want to make a popup or some type of inquiry menu where it asks the user to specify which worksheets in the workbook to print. I have a data entry page, and four printable worksheets.
Sometimes I only want to print two of the worksheets, but not the data page or the other two. Any way to do this besides printing the entire workbook or one worksheet at a time? It would be ideal if a popup menu came up with checkboxes for all of the available worksheets and the user could check off which ones to print.
I have a template with 25 very hidden sheets in it, my userform, unhides and slightly modify's some of the sheets. When my userform is completed, there are between 2 and 11 sheets visible. I am trying to put code behind a button on a sheet that will save all sheets to one PDF file. The code below works but makes individual files.
select all active files as pdf
I know it's close but the code to select all active sheets is messed up.
I have an Excel form that contains 7 tabbed worksheets, one for each day of the week Sun thru Sat, that is a nutrition tracker and an 8th tab which is a food library. I put two buttons on the food library to automatically sort it by different categories and they work great for me. Then I put a printer icon on each of the daily sheets to print a single worksheet (in B&W) with the following macro changing the "from" and "to" to correct worksheet number for each day. Screenprint below.
Using "Monday" worksheet as an example I first tried using sheet number 10 as shown in the VBA Project below for the "From" and "Two" and it printed the wrong pages, so I went to the worksheet number as they are tabbed in the file, Monday being sheet 2, and it works fine (on my computer).
It works great from my computer, but if I send it to someone else and they try to print they receive the following errors: When they open the spreadsheet and click the print button this error comes up:
If they click "OK" on the above error this comes up
I've tried to include information that is revelant.
how would I change the orientation on ALL my worksheets, I'm saying every single one, imagine I got like 100 for the purpose of this excercise (sorry I'm not trying to make this harder, it's just there's always that one guy that'll come on and say 'Go to Print Print Preview, then click on Setup' or something like that.
So yeah, that's pretty much the question that I have for you brainaics:
How do I change the printer orientation setting to landscape on all worksheets (maybe a loop?).
In the excel file is a VBA code that is combined with a button if someone click on the button a little menu shows with a multiple options of sheets that can be printed. Only the problem is when i hide the sheets the code doesn't see them anymore and the only I can print is the page where the button is placed.
I came across the following macro that generates a list of worksheets with check boxes to select the ones I want to print. I attached the macro to a button on my "Totals" worksheet. When I run the macro, it lets me pick the worksheets, but doesn't print anything unless "Totals" is one of the worksheets I selected in the dialog box. What is missing?
I also want to stop the screen flickering and have it go back to the "Totals" page when it's done since that's where the button is.
In my excel, i have 3 worksheets. On the first worksheet, i have 2 pages since i have 2 sections side by side. I can't stack the sections due to different column widths. I am trying to see if there is a macro to stack the 2 pages on the first worksheet as one pdf page, and then have worksheets 2 and 3 as pages 2 and 3 of the pdf.
I have a monthly template that has 31 tabs labeled 1 through 31 for the days of the month. I would like to add a macro that would print only the sheets that have a value greater than 0 in either of two specific cells.
I could add a summary sheet that would pull over these values and/or add if statements that return results like "don't print" or "print" if it would be easier in the macro or I could just use the code in macro to determine to print or not.
I am a record and tweak macro user and this isn't something you can record. I found some simple code in another post that would print one page based upon single criteria but it isn't exactly what I was looking for.
I am seeking the most efficient code to print all excel worksheets beginning with sheet "XYZ" and ending with the last sheet in the workbook.
- Sheet "XYZ" is always the starting point - The number of sheets after "XYZ" is variable - The names of the subsequent sheets are unique and not sequentially named/numbered - The printing will be to one report (i.e. don't print pages individually)
Is it possible to set the same print area and print settings i.e. Landscape and 1 page tall by 2 pages wide, across all worksheets in an excel file? I have a file with 365 worksheets. They all have the exact same layout and need to be printed off daily. I can set the print settings every day manually but was wondering if there is an easy way to do them all in one go?
I have a workbook with many sheets, all of which derive information from the first sheet. On the first sheet, I enter values from say J1:J29. Each of these values is fed into one of the subsequent worksheets. I would like to have some code that would look at my range, determine which cells are used and print the corresponding worksheets. Write now I have a bunch of If statements that say
If Sheets("Worksheet").Range("j8") > 0 Then Sheets("698-ALY W1222").PrintOut End If
the problem is that it takes to long as each statement is evaluated and the print command sent.
The values in column J have names in column I and while the names do not exactly match the worksheets, a person could look at the name and match the correct sheet. For instance the name in column I that corresponds to the worksheet name 698-ALY W1222 is 698/ALY.
I'm trying to print populated rows from 5 different worksheets. I can get them to print out onto 5 different sheets of A4 but would ideally like them to print underneath each other (continous and use less paper) as some times one sheet may only have one populated row.
Application. ScreenUpdating = False Dim printer1 As Range Dim printer2 As Range Dim printer3 As Range Dim printer4 As Range Dim printer5 As Range
Sheets("xxxx").Select Set printer1 = ActiveSheet.Range("a9", Range("i65536").End(xlUp))
Sheets("xxxx").Select Set printer2 = ActiveSheet.Range("a7", Range("i65536").End(xlUp))
I am making custom time sheets to suit our agriculture business - these excel sheets get sent out to the different farm managers who send back in staff times.
This code below is brilliant and works perfect for our needs. However I need to be able to emailPDF the sheets not print.How / where do I change code so the selected sheets go to Save & Send via email as a PDF instead of going straight to the default printer .( hard copy )
VB: Option Explicit Sub SelectSheets() Dim i As Integer Dim TopPos As Integer Dim SheetCount As Integer Dim PrintDlg As DialogSheet
All sheets are basically the same except some minor values, names and addresses. There is one page per sheet and all pages are in portrait format. The print preview shows all the pages in order but when I print it, it makes multiple print jobs of 1 to 2 pages each and prints them all out of order. I don't know why it is splitting up the workbook or why it changes the order. I print and reorder these weekly, which is a major pain. It comes out in the same order each time but it is the wrong order.