+ Reply to Thread
Results 1 to 5 of 5

Help Fixing Error on Print Macro

  1. #1
    Forum Contributor
    Join Date
    11-25-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    2010
    Posts
    146

    Help Fixing Error on Print Macro

    I found this on Ron DeBruins site. Works great, until I tried to modify it...
    Basically I want it to print any hidden sheets that have a value in cell A600. I changed one line in the code and now get the error in the attached file on the line indicated in the code. Also added the original code so you can see the change I made

    Please Login or Register  to view this content.
    error.PNG

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Help Fixing Error on Print Macro

    Hello groundin,

    You need to change the With..End With portion of your code. You can use an Array with the Sheets object to select sheets in workbook but not the Worksheets object. here is the corrected code.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    11-25-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    2010
    Posts
    146

    Re: Help Fixing Error on Print Macro

    Thanks, Changed it, but still getting same error...I was looking at the code, should i change
    Please Login or Register  to view this content.
    worksheets here to sheets as well?

  4. #4
    Forum Contributor
    Join Date
    11-25-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    2010
    Posts
    146

    Re: Help Fixing Error on Print Macro

    Hi Again,
    I tried changing the .Worksheets to .Sheets, but still got the same error. Here is the existing code.


    Please Login or Register  to view this content.
    Any help would be appreciated.
    Thanks

  5. #5
    Forum Contributor
    Join Date
    11-25-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    2010
    Posts
    146

    Re: Help Fixing Error on Print Macro

    Hi All,
    Here is the code that ended up doing what I needed it to do. Thanks for your time.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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