+ Reply to Thread
Results 1 to 5 of 5

Macro to select sheet thatīs Hidden

  1. #1
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852

    Macro to print sheet thatīs Hidden

    Hi,

    Thanks for the reply DCSwearingen:

    I am now trying to print this hidden sheet (1 page of data) so I changed the thread name.

    Please Login or Register  to view this content.
    The code above gives me an error.

    Any way of printing the data from this hidden sheet?Thanks
    Last edited by Portuga; 03-24-2008 at 05:42 PM. Reason: wrong title description
    If you found the solution to your question. Mark the thread as "Solved"
    Thank everyone that helped you with a valid solution by clicking on their

    There is no such thing as a problem, only a temporary lack of a solution

  2. #2
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    You do not need to unhide...

    Your macro probably tries to select or activate the hidden worksheet.

    Are you searching a range of cells?

    All you need to do is reference the sheet without selecting.

    I set up a two sheet workbook with a list of values in Sheet2.

    I then used Sheet1 cell B2 to use as the value to find.

    Put this code into the Sheet1 private module.
    Please Login or Register  to view this content.
    Changing the value in Sheet1 Cell B2, will place the address matching the value of B2 into C2. If no match is found it will clear C2.

    Good Luck!!
    Attached Files Attached Files
    Last edited by DCSwearingen; 03-24-2008 at 05:29 PM.
    Thanks!
    Dennis

    I am using Windows 7 and Office 2007, all of my posts are based on this.

  3. #3
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    Once again, do not select the hidden sheet.

    See the code I have hi-lighted in your code. Hidden sheets cannot be selected.

    Quote Originally Posted by Portuga
    Hi,

    Thanks for the reply DCSwearingen:

    I am now trying to print this hidden sheet (1 page of data) so I changed the thread name.

    Please Login or Register  to view this content.
    The code above gives me an error.

    Any way of printing the data from this hidden sheet?Thanks
    I have not tried this code and I am on my laptop away from a printer, but I think it will work. Any time you record and find a combination of ".select" in one line followed by "Selected" or "Selection", try deleting text between the "dot" before "select" and the "dot" following "Selected" or "Selection" similar to what I show in the folloing line.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    Hi Denis,

    No joy on your suggestion, I think its because, (and following your logic on the "select" command), the "activeworkbook" comand wouldnt work either... because the workbook is not active...
    (Circular reference?)

    So Iīm basically left with the line:

    Please Login or Register  to view this content.
    Which works by the way... but not when the sheet is hidden!

    So I decided to do a small test with another simple piece of code (with the sheet Hidden):

    Please Login or Register  to view this content.

    Puzzelled and defeated.
    Thanks anyway
    Last edited by VBA Noob; 11-08-2008 at 05:22 PM.

  5. #5
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    I appologize

    Please Login or Register  to view this content.
    works when the sheet is visible, even if not selected in the sample workbook I attached earlier... It does not work if the sheet is hidden.

    This may take some thought or one of the experts...

+ 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