+ Reply to Thread
Results 1 to 2 of 2

Macro to print and create a .csv

  1. #1
    Registered User
    Join Date
    04-16-2015
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    40

    Exclamation Macro to print and create a .csv

    Hi Guys

    I have a workbook that contains material worksheets all named accordingly. I have two main objectives that I am struggling with when it comes to VBA.

    Objectives:

    Print- to create a button that allows the user to be able to click it and print all of the filled areas on all of the worksheets. As you will see each data is stored in columns therefore it would be beneficial either for the print macro to automatically include the new column or to just set it to include all columns of this year, however how about next year as well is the question that I am struggling with.

    Export- to create a button that when clicked the user can create new .csv files all in one workbook, one worksheet all on one page. or if the easiest which I found is to create a macro for each material type however this is onerous and is a pain to then fix if they do go wrong, unless I think I am using the wrong formula.

    Basically there will be a homepage and on the home page I would love to insert a button and then that button will activate the Print Macro and the other button will then activate the export feature when clicked.

    N.B: The TimberGroupMeterage page has hidden cells and I would like for these cells to not appear as part of the .csv file.

    Please find attached workbook. Materials - Uni Work.xlsm

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Macro to print and create a .csv

    Firstly, just to clarify, as your file was called - Uni work.xlsm Ive assumed this is some kind of assignment therefore Im more than happy to give pointers but not solutions

    Quote Originally Posted by QuintonMcCloud View Post
    Print- to create a button that allows the user to be able to click it and print all of the filled areas on all of the worksheets. As you will see each data is stored in columns therefore it would be beneficial either for the print macro to automatically include the new column or to just set it to include all columns of this year, however how about next year as well is the question that I am struggling with.
    The answer to this depends on how you would decide which data is to be shown, for example, if you only want to show data for previous months (ie running it now would show columns A-K) then you can calculate the allowable columns using a calculation based on todays date. for instance take the current year and deduct 2015 from it, multiply that by 12 and then add on the current month. So todays would be (((2015 - 2015)* 12) + 8) which would give 8, therefore set your range to be your 4 initial columns plus this 8.

    Quote Originally Posted by QuintonMcCloud View Post
    Export- to create a button that when clicked the user can create new .csv files all in one workbook, one worksheet all on one page. or if the easiest which I found is to create a macro for each material type however this is onerous and is a pain to then fix if they do go wrong, unless I think I am using the wrong formula.
    Can you confirm what exactly is meant by the highlighted bit?
    If someone has helped you then please add to their Reputation

+ 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. Create a print macro that would automatically select print area?
    By wastedwings in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  2. Create a print macro that would automatically select print area?
    By wastedwings in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. Create a print macro that would automatically select print area?
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-06-2005, 06:05 AM
  4. Create a print macro that would automatically select print area?
    By wastedwings in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] Create a print macro that would automatically select print area?
    By wastedwings in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  6. Create a print macro that would automatically select print area?
    By wastedwings in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. [SOLVED] Create a print macro that would automatically select print area?
    By wastedwings in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  8. [SOLVED] Create a print macro that would automatically select print area?
    By wastedwings in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

Tags for this Thread

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