+ Reply to Thread
Results 1 to 9 of 9

Macro to Print to PDF the tabs between two tabs by click of button

  1. #1
    Registered User
    Join Date
    01-12-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    9

    Macro to Print to PDF the tabs between two tabs by click of button

    Hi,

    I am very new to the macro/VBA language world and need help writing a macro to print the tabs that are between two designated tabs to PDF. The button the macro should be assigned to is on the ADMIN tab. The tabs to print to PDF are the green tabs located between the two black tabs labeled Presentation. I've attached a dummy file because the actual file is too large to post.

    Any help is appreciated!!
    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Macro to Print to PDF the tabs between two tabs by click of button

    Would it always be those 3 or would it need to be dynamic and pick the ones between "Presentation -->" and "<-- Presentation"?

  3. #3
    Registered User
    Join Date
    01-12-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    9

    Re: Macro to Print to PDF the tabs between two tabs by click of button

    It will not be those three every time. It will be any tabs between the Presentation tabs. The number of tabs will vary each time.

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Macro to Print to PDF the tabs between two tabs by click of button

    One last question, would it be one pdf file or a pdf file for each sheet? If the former then:
    Please Login or Register  to view this content.
    Last edited by Kenneth Hobson; 01-12-2016 at 04:32 PM.

  5. #5
    Registered User
    Join Date
    01-12-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    9

    Re: Macro to Print to PDF the tabs between two tabs by click of button

    It will be one PDF file.

    Thanks!

  6. #6
    Registered User
    Join Date
    01-12-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    9

    Re: Macro to Print to PDF the tabs between two tabs by click of button

    Thank you Ken!

    How can it be changed to either (1) name the PDF file the same as the workbook it is pulling the data from, or,(2) give the option to Save As, so the location/name can be determined at that time?

    Thanks,
    Sherry

  7. #7
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Macro to Print to PDF the tabs between two tabs by click of button

    Depends on which one you want.
    As you can see from my pdf routine, passing the 3rd parameter as True meets choice (2).
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-12-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    9

    Re: Macro to Print to PDF the tabs between two tabs by click of button

    What makes it pass as TRUE?

  9. #9
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Macro to Print to PDF the tabs between two tabs by click of button

    I guess it would be you since I can't control your computer. I showed how to do it in #7.

    When passing parameter values to a routine, not all have to be passed if you see the word Optional. Optional parameters usually have a default value which in my routine is False and left out in the first code shown. Replace the line of code in the call shown in #4 with what I showed in #7.

+ 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. Macro Button to move 2 tabs to a new workbook
    By tmleynek in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-16-2015, 11:55 AM
  2. Macro help: Separating data into tabs and creating a table of content of those tabs
    By AntiPivotTable in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-15-2015, 11:57 AM
  3. [SOLVED] Macro to print multiple tabs
    By jono7gold in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-13-2014, 10:05 AM
  4. How to have a macro print output to individual tabs in a new workbook?
    By RG Series in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2012, 10:34 AM
  5. Replies: 6
    Last Post: 02-01-2012, 05:29 PM
  6. Rename worksheet tabs and sheets to match tabs via button
    By timgavin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-31-2011, 06:12 PM
  7. Macro which will select certain tabs to print
    By Cineplex in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-18-2008, 11:53 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