beforeprint

  1. J

    BeforePrint Event VBA Issues

    I have a template that should only be used if it is for a certain ship to that ends up in a specific cell in t he workbook. I want to keep them from printing the file if the ship to does not match what I need it to match. I have the below code in the ThisWorkbook module. Private Sub...
  2. B

    VBA BeforePrint MsgBox

    I have a form that people fill out, print, and scan to me. I want to set a macro so that when they hit print, it pops up a message box that reminds them I need their cover page and calculations pages. I have read dozens of help forum posts and copied many of the codes into sample excel sheets to...
  3. P

    VBA to Validate Data

    Hello, I am a true beginner to VBA and would like some help in creating a macro that is triggered when the user goes to save the document. The document contains a check box and, if checked, cell B28 will show TRUE. If the check box is checked, the user is expected to enter additional...
  4. D

    Handling print preview cleanly with beforeprint event handler

    Hi! I've tried trapping printing as per the thread "Workbook_BeforePrint(Cancel As Boolean) ...how about AfterPr" at http://www.mrexcel.com/forum/excel-questions/1659-workbook_beforeprint-cancel-boolean-how-about-afterpr.html. As mentioned in the thread, the same code runs for both Print and...
  5. Mat

    Exit BeforePrint if PrintPreview

    Hi, I have code in my Workbook_BeforePrint routine, but I don't want it to be executed if the event is triggered by the PrintPreview, so I can I know if the event has been raised by the PrintPreview button instead of the Print button? Thank you
  6. C

    PrintOut & xlDialogPrint skipped

    I have a workbook that by default shows 1 sheet where the user makes selections from a listbox. Once the selections are made, new sheets are created for each of them in this workbook. I have created a button that should both create and print by clicking on it. The code for this is: Sub...
  7. S

    How Do I Designate a Column in My Macro

    I am using the following 2 macros to change the font color from Black to White before printing and then back again once I save the file. I never could get Lenze's solution from Feb 2002 to work. Just for the record, Lenze has helped me plenty (directly and indirectly), so I'm not hating...
  8. G

    Print Preview freezing Excel after BeforePrint VBA run

    Dear All, I am having trouble with Print Preview in a file with a Workbook_BeforePrint event. I have an Excel 2003 workbook that contains VBA code. In Private Sub Workbook_BeforePrint(Cancel As Boolean) I have code that if conditional formatting is turned on in a range of cells, then: Cancel...
  9. S

    Need to use Print Preview while using BeforePrint Event

    I am using Excel 2007 I have this code in my ThisWorkbook Module: Private Sub Workbook_BeforePrint(Cancel As Boolean) Sheets("Sheet1").Range("B2,B5,B8,B13").Font.ColorIndex = 2 End Sub I have this code in each Worksheet Module I want to use it for: Private Sub...
  10. J

    VBA Application Event - BeforePrint

    I've exhausted my searches trying to bang this out, when I know I can solve my probably in an un-sexier manor by creating a macro that overrides CTRL+P to run spell check and then print. However, I am hell-bent on figuring this thing out. My goal: to force excel to run spell check before I...
  11. J

    Print button breaks code but Manual print doesnt - help needed

    Hi, I have an excel sheet which creates delivery notes. Every time a delivery note is printed, I want to track it in another sheet. I have the following line of code linked to a button. ActiveWindow.SelectedSheets.PrintOut copies:=5 The problem is that the below macro runs when the...
  12. C

    How to identify in BeforePrint if choice was Preview or Print?

    I am needing to run a macro AFTER printing. Since there is no AfterPrint, the only way to do this is to trap with Workbook_BeforePrint, cancel the automatic print/preview, code it manually and followup with the macro. (Excel 2003) My problem now is knowing if the user chose Preview or Print...

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top