+ Reply to Thread
Results 1 to 5 of 5

Run code from any page to save as PDF

  1. #1
    Registered User
    Join Date
    02-04-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    23

    Run code from any page to save as PDF

    is it possible to call the following code from any worksheet?

    i get type mismatch if i call the code from any worksheet except Note. it works perfectly if i run the code when i am on Note worksheet. Thanks


    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,755

    Re: Run code from any page to save as PDF

    Try changing Set srcWS = Sheets("Note") to Set srcWS = ActiveSheet
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,755

    Re: Run code from any page to save as PDF

    Or, maybe

    Please Login or Register  to view this content.

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

    Re: Run code from any page to save as PDF

    does "x" have any significance in the process as it is a string in one instance and also a declared numeric variable.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,755

    Re: Run code from any page to save as PDF

    @torachan: I suspect it is just confusing. I think the loop, using numeric variable x, is looking for an "x" in the range to flag sheets to be selected.

+ 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] modifying code save hidden sheets as pdf separately pages instead of at one page
    By MKLAQ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2021, 09:07 AM
  2. Save second web page source code as a text file
    By Samadhan10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2017, 01:33 AM
  3. Replies: 9
    Last Post: 06-18-2015, 03:12 PM
  4. Modify existing code to save as pdf at page breaks and rename as per cell value
    By byfield8 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2015, 11:58 AM
  5. Replies: 12
    Last Post: 07-30-2014, 04:34 PM
  6. [SOLVED] Save selected pages to desktop without running each page code?
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2012, 11:56 PM
  7. [SOLVED] How do I save one page out of a 80 page report in excel?
    By bellamere in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-15-2006, 04:30 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