+ Reply to Thread
Results 1 to 1 of 1

Save multiple sheet/print sheet with one command button

  1. #1
    Registered User
    Join Date
    09-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    10

    Save multiple sheet/print sheet with one command button

    I have a button on a sheet 1 in a workbook in which I want to make an order invoice a one step process when someone puts an order form. One sheet is the order form, one sheet is a form that needs saved without the first name cell to keep confidentiality and I want this saved in a PDF in order to send to the company in order for them to bill us, the third sheet is an authorization that copies what a person wants to order and wants this saved in order for it to be e-mailed to the person to authorize the order, but sometime a person would not need an authorization form.

    I can get it to do each of the 3 things that I want to happen, but not all to happen at once. Is this possible, or will I need to have more buttons?

    This code will print authorization form and print order form.

    [Code]
    Private Sub CommandButton2_Click()
    Dim BDForm As Workbook
    If (MsgBox("Do you need a Authorization form?", vbYesNo, ("Print Authorization form"))) = vbYes Then
    Sheets("Authorization Form").Select
    ActiveSheet.PrintOut


    Else

    End If


    Sheets("BD_Order_Form").Select

    ActiveSheet.PrintOut

    End Sub
    [\code]

    This code will print order form and save in copy of the confidential copy in PDF form to be e-mailed later.

    [code]
    Private Sub CommandButton3_Click()
    Dim BDForm As Workbook

    Sheets("Copy_BD_Order_Form").Select
    ActiveSheet.Copy

    Set BDForm = ActiveWorkbook


    With BDForm
    ActiveWorkbook.ExportAsFixedFormat Type:=xltypepdr, Filename:= _
    "C:\KIM_NICKLIN\BD" & Range("I5").Value & ".PDF", quality:= _
    xlQualityStandard, includedocproperties:=True, ignoreprintareas:=False, _
    openafterpublish:=False
    .Close

    End With

    Sheets("BD_Order_Form").Select




    ActiveSheet.PrintOut


    End Sub
    [\code]

    This code will print order form and save a copy of the order form in an excel form to be edited later if needed.
    [code]
    Private Sub CommandButton3_Click()
    Dim printsave As Workbook

    Sheets("Copy_BD_Order_Form").Select
    ActiveSheet.Copy

    Set wbNew = ActiveWorkbook
    With wbNew
    ActiveWorkbook.SaveAs Filename:= _
    "C:\KIM_NICKLIN\BD" & Range("I1").Value & ".xlsm" _
    , FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
    .Close
    End With
    Sheets("BD_Order_Form").Select


    ActiveSheet.PrintOut


    End Sub
    [\code]

    I would like a button to do all three things, but I am new at writing code and am learning how to do code with multiple functions.

    Would like some help in how to do this.

    Thanks,
    GJR
    Attached Files Attached Files
    Last edited by GJR; 04-24-2014 at 10:01 AM. Reason: Better show of coding I have that works.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Want to print Multiple Invioce for One Sheet by single Command
    By caanandrai in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2013, 05:28 AM
  2. Transfering data from one sheet to a master sheet using Submit (command button)
    By readitdaily in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-02-2013, 09:15 AM
  3. [SOLVED] command button: specified sheet copy and save as new workbook to specified location
    By Zlatko.Pan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2013, 12:28 PM
  4. Copy Data to a New Sheet if criteria match (multiple) using a Command Button
    By bambobeee in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-03-2013, 12:37 AM
  5. Command button - to copy active sheet and not save current workbook
    By vjboaz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2008, 05:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1