+ Reply to Thread
Results 1 to 7 of 7

Unable to hide columns in another worksheet from within worksheet_change procedure

  1. #1
    Registered User
    Join Date
    03-07-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    3

    Unable to hide columns in another worksheet from within worksheet_change procedure

    Hi Folks,

    This is very frustrating and I hope someone might have the answer.

    I have a worksheet_change procedure that is triggered when certain cells in my input sheet are changed. The procedure is supposed to go into another sheet and hide some columns. Its doesn't. The procedure is certainly triggered, it just seems to skip over the lines of code that do the looping and hiding. I fear it might be something to do with loosing focus?

    Also, I can't seem to actually step through the procedure. It's like this procedure is somehow exempt from the usual debugging functionality of the VBA Editor.

    Any ideas?

    Here's the code:

    Please Login or Register  to view this content.
    Last edited by TMS; 03-08-2012 at 03:28 AM. Reason: Header did not meet policy. Fair enough.

  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,431

    Re: I'm going crazy! How do I hide columns in another worksheet from within worksheet_chan

    Welcome to the forum. Unfortunately:

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.




    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    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
    Registered User
    Join Date
    03-07-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: I'm going crazy! How do I hide columns in another worksheet from within worksheet_chan

    Hi,
    THanks. I've redone the header, but I don't know what you mean about "tags". THere is no # sign at the top of my post window.
    MJ

  4. #4
    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,431

    Re: Unable to hide columns in another worksheet from within worksheet_change procedure

    After you've clicked Edit, you need to select "Go Advanced", select the code and then click on the # icon. I'll do it this time to save time for both of us

  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,431

    Re: Unable to hide columns in another worksheet from within worksheet_change procedure

    Try:

    Please Login or Register  to view this content.

    You shouldn't need to activate the sheet but you do need to link the ranges to the sheet within the With ... End With


    Regards, TMS

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Unable to hide columns in another worksheet from within worksheet_change procedure

    Please Login or Register  to view this content.



  7. #7
    Registered User
    Join Date
    03-07-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Unable to hide columns in another worksheet from within worksheet_change procedure

    Hi TMShucks,

    Thanks very much. I really appreciate your efforts, but it doesn't work!

    The code works in its own procedure, but it does not work in the worksheet_change procedure. THis is the real problem.

    Here is the code, incorporating your changes, inside the worksheet_change procedure. You can ignore the bit that deal with the "flexitest" stuff, the relevant stuff is from the second "set combined..." statement:

    Please Login or Register  to view this content.
    Any ideas anyone?

    My frustration is nearing boil-over!

    Cheers,

    Mark

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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