Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The code below works.
First question is when the dialog box appears for the user's input on which printer Application.Dialogs(xlDialogPrinterSetup).Show If you click cancel, it still sends the print. Is there a way to cancel the sub if the cancel button is clicked? Second question is after the user clicks the PRINT command button and sends the print, the button is still focused. In code I only know to place Range("A7").Select to unfocus the button. Without this line the button remains focused. If you press the Esc key it unfocuses. I would like the result to be similar to the Esc key with having to select a cell. Possible? How? ----------------------------------------------------- Private Sub CompletionTablePrint_Click() On Error GoTo addError Application.Run "Module5.UnProtectPDSR" Worksheets("CompletionTable").Activate Application.Dialogs(xlDialogPrinterSetup).Show Set c = Worksheets("CompletionTable").Columns("K"). _ Find("0", LookIn:=xlValues) If Not c Is Nothing Then Worksheets("CompletionTable").Range(Cells(1, 1), Cells(c.Row, 9)).Select ActiveSheet.PageSetup.PrintArea = Selection.Address ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Range("A7").Select Application.Run "Module5.ProtectPDSR" End If Application.Run "Module6.CompletionFilter" Exit Sub addError: MacName = "CompletionTablePrint" MyErrorRoutine Err.Number, Err.Description, MacName End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Printing code | Excel Discussion (Misc queries) | |||
Some help with Printing code | Excel Programming | |||
code for printing | Excel Programming | |||
VBA Code printing problem | Excel Programming | |||
Printing code | Excel Programming |