+ Reply to Thread
Results 1 to 3 of 3

Hidden Worksheet

  1. #1
    Forum Contributor
    Join Date
    01-19-2006
    Posts
    142

    Hidden Worksheet

    Hi all,

    I have a sheet that contains all the data for the app, is it possible to have this sheet hidden but still be able to select the data from it using vb code?

    When i do hide the sheet and use the select code;

    Please Login or Register  to view this content.
    It produces an error - "Select Method of Worksheet Class Failed"

    Any suggestions?

  2. #2
    Chip Pearson
    Guest

    Re: Hidden Worksheet

    You can only Select a range on the Active Sheet, and since your
    worksheet is hidden, it will never be the Active Sheet. That
    said, it is (almost) never necessary to Select anything in VBA.
    Perhaps if you fully describe what you want to accomplish,
    someone will post a solution that doesn't need a Select.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "gti_jobert"
    <[email protected]> wrote
    in message
    news:[email protected]...
    >
    > Hi all,
    >
    > I have a sheet that contains all the data for the app, is it
    > possible
    > to have this sheet hidden but still be able to select the data
    > from it
    > using vb code?
    >
    > When i do hide the sheet and use the select code;
    >
    >
    > Code:
    > --------------------
    >
    > Sheets("RelationalData").Select
    >
    > --------------------
    >
    >
    > It produces an error - "Select Method of Worksheet Class
    > Failed"
    >
    > Any suggestions?
    >
    >
    > --
    > gti_jobert
    > ------------------------------------------------------------------------
    > gti_jobert's Profile:
    > http://www.excelforum.com/member.php...o&userid=30634
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=511699
    >




  3. #3
    Arvi Laanemets
    Guest

    Re: Hidden Worksheet

    Hi

    Both code snippets below work with sheet RelationalData hidden or even very
    hidden:

    ....
    ReadValue=ThisWorkbook.Sheets("RelationalData").Range("A1").Value
    ....
    ActiveSheet.Range("A1").Value=ThisWorkbook.Sheets("RelationalData").Range("A1").Value


    --
    Arvi Laanemets
    ( My real mail address: arvi.laanemets<at>tarkon.ee )


    "gti_jobert" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi all,
    >
    > I have a sheet that contains all the data for the app, is it possible
    > to have this sheet hidden but still be able to select the data from it
    > using vb code?
    >
    > When i do hide the sheet and use the select code;
    >
    >
    > Code:
    > --------------------
    >
    > Sheets("RelationalData").Select
    >
    > --------------------
    >
    >
    > It produces an error - "Select Method of Worksheet Class Failed"
    >
    > Any suggestions?
    >
    >
    > --
    > gti_jobert
    > ------------------------------------------------------------------------
    > gti_jobert's Profile:
    > http://www.excelforum.com/member.php...o&userid=30634
    > View this thread: http://www.excelforum.com/showthread...hreadid=511699
    >




+ 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