+ Reply to Thread
Results 1 to 12 of 12

VBA to save sheet as print area

  1. #1
    Registered User
    Join Date
    06-14-2018
    Location
    LONDON
    MS-Off Ver
    2007
    Posts
    29

    VBA to save sheet as print area

    Hi I am trying to change this code so that it only saves the print area of the active sheet, is anyone able to help. I think it's almost their just needs a slight change, as I'm sure you can tell, I don't know much about VBA

    Please Login or Register  to view this content.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: VBA to save sheet as print area

    Are you wanting to save as pdf as per this link here
    then you must specify the print area...
    Please Login or Register  to view this content.
    Last edited by sintek; 03-25-2020 at 04:58 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    06-14-2018
    Location
    LONDON
    MS-Off Ver
    2007
    Posts
    29

    Re: VBA to save sheet as print area

    Hi thanks for the reply,

    No I wanted to save it as a macro-enabled worksheet/workbook, on the other pages I have confidential information that cannot be included

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: VBA to save sheet as print area

    Don't think I understand...Please elaborate...

  5. #5
    Registered User
    Join Date
    06-14-2018
    Location
    LONDON
    MS-Off Ver
    2007
    Posts
    29

    Re: VBA to save sheet as print area

    I have 5 sheets in my workbook, 4 of the sheets contain information such as pricing & customer names, addresses ect which I don't want to be included in the new excel document I am creating...

    One of the sheets, "sheet 1" I would like to save into a public folder by clicking a button. ("C:\Users\" & username & "\Dropbox\QUOTES")

    Basically, what I am trying to do is save the print area of one "sheet 1", have the file name as "K3" & the file location as "C:\Users\" & username & "\Dropbox\QUOTES" & the format to be macro enabled workbook so that it can be edited by other users.

    It's quite important that they can't see the other four pages. Sorry if I haven't explained myself very well.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: VBA to save sheet as print area

    So why not just hide these sheets...xlsheetVeryHidden or delete the sheets prior to save...
    What macros does the workbook contain pertaining to those sheets only that these users need to access
    Last edited by sintek; 03-25-2020 at 05:42 AM.

  7. #7
    Registered User
    Join Date
    06-14-2018
    Location
    LONDON
    MS-Off Ver
    2007
    Posts
    29

    Re: VBA to save sheet as print area

    Deleting them could work. I'm guessing this isn't easy to do?

    I also thought about VBA to copy & pasta a .PasteSpecial for all followed by a .PasteSpecial xlValues, I thought this would be more difficult though.

    With regards to deleting the other sheets, is this possible through VBA, whilst at the same time saving as a new workbook with filename as K3 & in a set folder?

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: VBA to save sheet as print area

    Please Login or Register  to view this content.

  9. #9
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: VBA to save sheet as print area

    Are there macros on sheet1, if not what is the point of saving as .xlsm ?????

  10. #10
    Registered User
    Join Date
    06-14-2018
    Location
    LONDON
    MS-Off Ver
    2007
    Posts
    29

    Re: VBA to save sheet as print area

    Sorry I don't know why I didn't think of this before, once the other sheets are deleted, on sheet 1 it comes up with #REF because they were linked to the deleted pages. Are you able to help with copy & pasting format then values then saving as K3 in the folder?

  11. #11
    Registered User
    Join Date
    06-14-2018
    Location
    LONDON
    MS-Off Ver
    2007
    Posts
    29

    Re: VBA to save sheet as print area

    Say to copy the activesheet range A1:H28 to a new worksheet, paste as format & column spacing, followed by values. Then save as K3 from the original workbook? I don't know if this would work?

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: VBA to save sheet as print area

    chris888...Put us out of our misery and upload a sample file...
    Also answer some of the questions...Why macro-enabled...what code pertains to the sheets etc etc...
    What functions does the users need...
    As you have formulas linked to the other sheets...You need these sheets in the file...
    If you only want formulas then why need to save as macro enabled

+ 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. [SOLVED] Save to PDF with defined name for print/save area
    By austie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-29-2018, 11:53 PM
  2. Set print area and save as pdf
    By Jean-Felix in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-11-2018, 02:05 AM
  3. Macro, to Set Print Area, Save as, Print
    By paul0872829332 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-29-2015, 04:57 AM
  4. A way to save 'set print area' views?
    By Curious Dude in forum Excel General
    Replies: 3
    Last Post: 06-25-2015, 01:37 AM
  5. Save set print area as PDF
    By benjuk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2015, 07:23 PM
  6. Save Print Area as PDF
    By moosmahna in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-29-2013, 09:29 AM
  7. Print area and save to pdf
    By saniamarco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2013, 05:39 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