+ Reply to Thread
Results 1 to 7 of 7

Formula's not working Properly, and acting completely bizarre!

  1. #1
    Forum Contributor
    Join Date
    02-14-2011
    Location
    West Valley City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    108

    Formula's not working Properly, and acting completely bizarre!

    Hello all,

    I've got a very very strange situation that I will try to describe as best I can, and unfortunately I can't post my workbook because it is to large.

    A bit of background knowledge, Ive got two sheets working together: sheet 1 has some activeX boxes that when clicked, return a value in column Z on sheet 1 (activeX box #1 returns a 1 in Z1 when clicked, and a 0 when unclicked. Activebox #2 returns a value to Z2, and so un until Z9, which is my last cell that does this). I'm going to link a TON of code, and usually I would only link enough to get my point and purpose across, but in this specific situation I feel the entire code must be present.
    Please Login or Register  to view this content.
    I'm using the code below to run the above code anytime sheet #2 is activated.
    Please Login or Register  to view this content.
    So, now to my actual issue. When I click Box 1 (activeX box 1, ill just refer to them as "box") on sheet 1, it returns a 1 to Z1, and when I change to sheet 2, it works perfectly. When I do the same with Box 2, it also works perfectly. When I do the same with Box 3, it also works perfectly.

    When I click Box 4, however, it returns a 1 to Z4, but it runs the code for Z6, listed below.
    HTML Code: 
    Box 5 has the same issue, and both Box 5 and Box 4 I've managed to solve by switching their perspective codes (If Z4 is supposed to show Rows 500-550 and Z5 is supposed to show rows 551-600, and Z4 is showing 551-600 while Z5 is showing 500-550, even though the code says it should do otherwise, I switched the code so If Z5 = 1, show row 500-550, and it does so even though Z5 has no value, and Z4 has the 1. Rereading this, I probably didnt make that clear, but I'm on a tight time frame so I will elaborate on that Tuesday morning.)

    I'm out of room, so I'm going to post another comment after to continue.
    Last edited by Sky188; 10-04-2012 at 01:05 PM.

  2. #2
    Forum Contributor
    Join Date
    02-14-2011
    Location
    West Valley City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Formula's not working Properly, and acting completely bizarre!

    To continue with the strange code effects, When I click Box 8 and Z8 = 1, it hides everything rather than running the below code.
    Please Login or Register  to view this content.
    That is my situation in a nutshell, and I shall try to be more informative on Tuesday. Have a wonderful weekend, and thanks for the comments!

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Formula's not working Properly, and acting completely bizarre!

    Sky188,

    Try changing the sheet2 worksheet_activate event to the following code:
    Please Login or Register  to view this content.
    And then remove the HIDEROWUSINGTEXT macro. Also make certain your "boxes" are changing the proper cells on the proper sheet. The worksheet activate event looks at cells on sheet2. If the boxes are changing cells in sheet1, the wrong rows will get hidden.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor
    Join Date
    02-14-2011
    Location
    West Valley City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Formula's not working Properly, and acting completely bizarre!

    Thanks for the reply Tigeravatar, I really appreciate the amount of time you took to look at my problem. I made the corrections above, and it seems that when Z6 =1, it is still running the code for when Z9 = 1, and when Z9 =1, it doesn't run anycode and all rows between 1 and 1908 are hidden.

  5. #5
    Forum Contributor
    Join Date
    02-14-2011
    Location
    West Valley City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Formula's not working Properly, and acting completely bizarre!

    Attached is the sheet I'm working with. The vast majority doesn't work due to deleting my corporate files, but the hiding/unhiding still works.
    Pricing Document.xlsm

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Formula's not working Properly, and acting completely bizarre!

    Sky188,

    Quote Originally Posted by tigeravatar View Post
    make certain your "boxes" are changing the proper cells on the proper sheet. The worksheet activate event looks at cells on sheet2. If the boxes are changing cells in sheet1, the wrong rows will get hidden.

    Your checkboxes are changing cell values in the 'Questionairr' sheet, not the 'Products' sheet. The worksheet_activate event is on the 'Products' sheet so it can't see the cell values in other sheets unless explicitly told, like so:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-14-2011
    Location
    West Valley City, Utah
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: Formula's not working Properly, and acting completely bizarre!

    This worked wonderfully.
    tigeravatar, you are amazing, my good sir. I really appreciate your time and assistance.

+ 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