+ Reply to Thread
Results 1 to 6 of 6

Save/Print Macro

Hybrid View

  1. #1
    Registered User
    Join Date
    12-17-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Save/Print Macro

    Hello,
    I have a spread sheet that has three worksheets. The first is my quote form, the second contains all my information to run my formulas, and the third is my data or addresses. I have it setup so that when an address and delivery charge is populated in my quote it auto adjusts the prices. Everything works great except I ran into 2 problems.

    1. I would like to have a button that pulls an address & delivery cost and inserts them into my quote.( I set this up and it works great) I set a Clear button up to clear this info. How can I make the next address populate in my quote? It only does the first address.

    2. I would like to have a functioning save/ print button that saves the current quote in my C: drive in my MULCH folder. And also prints a copy. Is this possible?

    I have included the spreadsheet. Thank you for your help!!! 2013.xlsm

  2. #2
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Save/Print Macro

    Hi,
    I have added a userform to select the customer you want to import data for.
    it also pulls the customer name over - this acts as the filename to use when saving the order as a new work book.

    when you click save it copies the data to a new workbook, saves it as the filename.
    you can choose to save to desktop or change the location to your folder, see code in CreateWB.

    I cant do much with the print part as it depends what you are using. If it is a printer you will need to record a macro for the printing part and then run it to see if it works. If you have have cute pdf installed I can do code to save as pdf.

    hope this works for you.
    Attached Files Attached Files
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  3. #3
    Registered User
    Join Date
    12-17-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Save/Print Macro

    Thank you! that is what I was looking for!!!

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,714

    Re: Save/Print Macro

    Here are the revised codes for the selection of the customer and the clear button

    Sub test3()
        Dim cus As String
        Dim rng As Range
        cus = InputBox("Which Customer?")
        Set rng = Sheets("Form").Range("A1")
        Dim x As Variant
        x = WorksheetFunction.Match(cus, Sheets("Data").Range("C:C"), 0)
        rng.Value = Sheets("Data").Range("A" & x)
        
    End Sub
    Sub clear()
    
        Range("A1:D3").ClearContents
    
    End Sub
    For the printing, what is the print range?

    Alternative to an input box for the customer name, you may want to use a combo box to select the name.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    12-17-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Save/Print Macro

    Thank you for the codes!

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,714

    Re: Save/Print Macro

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. where can i find macro codes for various functions such print, save and save as
    By fellayaboy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2011, 02:06 AM
  2. Print only visible rows and a print to or save as pdf Macro
    By rlebeausw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-08-2011, 10:08 PM
  3. Copy Save File As then Print macro
    By larzep in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-24-2011, 10:35 PM
  4. save as and print options macro
    By ramblin racer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-01-2007, 03:48 AM
  5. Recording Macro to save worksheet and print
    By dmacman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2005, 11:36 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