+ Reply to Thread
Results 1 to 14 of 14

How Can I make a Macro work to Hidden Sheets?

  1. #1
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    How Can I make a Macro work to Hidden Sheets?

    OR can I? I get a "Run Time Error '1004' Select Method of Worksheet Class Failed"

    Is there anyway around this?

    Basically all the sheets are hidden from the user except for the Entry sheet. They input there data on there and then they press a send command button which then needs to copy that information to a hidden sheet. This is where the problem occurs.. Thought maybe their was a way around that or do I need to unhide the sheets during the macro and then rehide them again?

    Thanks for the advice!
    Last edited by mrgillus; 08-21-2009 at 03:05 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How Can I make a Macro work to Hidden Sheets?

    You can not use code that has .Select or Selection in it if the sheet is hidden.

    You can still manipulate the hidden sheet but you must adjust your code.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: How Can I make a Macro work to Hidden Sheets?

    http://www.excelforum.com/excel-prog...en-sheets.html

    Previous Post--

    So can you do something other than selecting them to make this work? Maybe activate?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How Can I make a Macro work to Hidden Sheets?

    It really depends on what 'make this work" is.

    for example.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: How Can I make a Macro work to Hidden Sheets?

    Ok.. Let me work with that for I while.. I have a lot of lines of code to go through and correct due to it being created mostly in a macro but I will get back to ya!

    Thanks for the help!!

  6. #6
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: How Can I make a Macro work to Hidden Sheets?

    Ok this appears to work! Just tested on my first copy method..

    The code that didn't work with hidden sheets was:

    Please Login or Register  to view this content.


    The method that works with the hidden sheet is:

    Please Login or Register  to view this content.

    Let me know if that is the proper way to write it.. It seems to be working that way though.

  7. #7
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: How Can I make a Macro work to Hidden Sheets?

    Please Login or Register  to view this content.
    I'm struggling with this bit of code.. Basically I need to rewrite it so that it will work since both the sheets involved here are hidden..

    Thanks!

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How Can I make a Macro work to Hidden Sheets?

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: How Can I make a Macro work to Hidden Sheets?

    Hmm.. Well that is working to the point that it does not start copying at the end of the last cell that contains data. Is the End(xlUp) causing it to jump back up before it pastes?

  10. #10
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: How Can I make a Macro work to Hidden Sheets?

    Okay it works, i fix..

    Turns out my merged cell at the bottom that I was using as a stopper of sorts stopped working during the conversion of the code..

    All I did was add a letter in the merged cell at the bottom and changed the font color to white so it was not visible and now the macro knows where to stop.

    Thanks a bunch for the help.. I'll see if I can't stumble through the remainder of the code and get back to you if I have any more problems.

  11. #11
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: How Can I make a Macro work to Hidden Sheets?

    I have another section of code that is giving me trouble.. Basically I'm trying to use the existing line with an input box.. Here is what I got:

    First is the Inputbox section.. FYI I'm a noob so I made this work however I could get it.. with the help of Roy that is! Thanks Roy!

    Then the inputbox references to my macro and basically the macro takes over the paste operation of this task.

    Please Login or Register  to view this content.

    This part works just fine Basically it copies the section I need and then the macro would paste it, remember that this code needs to work with hidden sheets..

    Please Login or Register  to view this content.
    The Line highlighted in red is where my error occurs.
    "Run-time error '438':"
    "Object doesn't support this property or method."

    Maybe I could get some help with this line of the code? Just need this to paste on the next empty line down just like one of Andy's previous posts where the line looked like:

    Please Login or Register  to view this content.
    Thanks again all for the help!

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How Can I make a Macro work to Hidden Sheets?

    The red line references a cell but doesn't do anything.
    Entia non sunt multiplicanda sine necessitate

  13. #13
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How Can I make a Macro work to Hidden Sheets?

    Your red line fails as it not really doing anything where it is.

    In the example I posted the style of code was used to determine the destination cell.

    so maybe,

    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    07-08-2009
    Location
    Missouri
    MS-Off Ver
    Excel 2003
    Posts
    183

    Re: How Can I make a Macro work to Hidden Sheets?

    Yeh.. Okay cool that works, But I had to write it into the commandbutton sub instead of sending it to a macro.. :

    Please Login or Register  to view this content.
    That is the completed code working!

+ 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