+ Reply to Thread
Results 1 to 12 of 12

Using a lookup based upon cell attributes

  1. #1
    Registered User
    Join Date
    03-02-2007
    Posts
    26

    Using a lookup based upon cell attributes

    Lets say that you have three cells. The contents of the cells are 1, 2, 3. The contents 1 and 2 have the strikethrough and 3 does not.

    How can you perform a lookup from within another cell to find the cell whose content does not have the strike through? (This could also be a search based on finding the cell that does not have the red background etc...)

    Thanks,

    John

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    A regular vlookup() function cannot handle this problem ...
    You will need a macro (or an UDF) to test the attribute ...
    Please Login or Register  to view this content.
    HTH
    Carim


    Top Excel Links

  3. #3
    Registered User
    Join Date
    03-02-2007
    Posts
    26
    Thanks,
    I was trying to manage this in a way that the users would not have to run a lot of embedded macros.

    J

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Difficult to guess what your actual objective is ...
    May be an event macro could solve this issue ...
    Why don't you upload a zipped copy of your worksheet for a precise answer ...?

  5. #5
    Registered User
    Join Date
    03-02-2007
    Posts
    26
    Thank you for your help.

    I've attached a starting point for what I'm trying to do.
    Attached Files Attached Files

  6. #6
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Attached is a starting point ...
    1. Reset button allows you to reformat all your selection area
    2. Double-Click on cells to identify and eliminate possible choices
    3. UDF NoStrike() in row 13 tracks automatically each selection left ...
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-02-2007
    Posts
    26
    Carim,

    Thank you very much for your help.

    The file works fine.
    It does have a small problem.
    When I try to add an additional search row, or change the name of on of the row titles I get a #value where the results were posting in the "yellow" box.

    I even went into the macro file, and edited the row title to match the name of the new title or additional search row.

    Is there some where else I need to look?

    Thanks again.

    J

  8. #8
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    What do you mean by an additional search row ...?

  9. #9
    Registered User
    Join Date
    03-06-2007
    Posts
    13
    Hi,

    With regards to changing the name of one of the row titles, if you go to Insert > Name > Define and change the title there as well, then this should get rid of the #value error in the yellow boxes.

    If you want to add a new search row you'll need to create a 'name' range in the same dialog box as above, and add this to any line in the macros that start 'Set Choices = Union'.

    I hope this helps.

    Steve

  10. #10
    Registered User
    Join Date
    03-02-2007
    Posts
    26
    So far so good.

    Thanks steve for the clarification. It works now with newly added rows.

    Now for another question (3 actually):
    1 - As I add different sort rows, it gets quite tedious that the while page gets cleared when the reset button is pressed. I looked for the button in the macro to try to add it to work on each row, but there isn't anything there that I can identified (If knew all of the VB tricks I wouldn't be here. LOL)
    2 - Some sort criteria could have more than one option, so how can the total cells be expanded to include more than one selection?
    3 - How does the button get added. There seems to be hidden stuff here, so I'm floundering on trying learn how to do this.

    Thank you all again.

  11. #11
    Registered User
    Join Date
    03-06-2007
    Posts
    13
    If you go to Tools > Customize, and select the toolbars tab, you will find Visual Basic in the list, tick this to have the toolbar added.
    Then if you click the Control Toolbox Icon (it looks like a hammer and spanner) you can create a button. To tell Excel what to do when the button is pressed you need to go to the Visual Basic Editor, and view the code for the sheet that the button is in. From there you need to use the drop down lists at the top of the code window to select the button, and what event to run a macro for. For your spreadsheet, if you go into the VB Editor and double-click Sheet1 in the Project window on the left you should be able to see the code that executes when the button is pressed. Hopefully this will be enough for points 1 and 3.

    I've tried to come up with a solution to point 2, which I believe I have done, however I don't know how to get rid of the squares after each line.

    Also I've amended the code that's run when you double click on a cell so that it determines whether to add or remove the strikethrough, so you don't have to reset if you make a mistake.

    You should also now find that the sheet resets quicker now too.
    Attached Files Attached Files
    Last edited by lshooter3k; 03-08-2007 at 10:00 AM. Reason: Amended file to make the reset button function faster

  12. #12
    Registered User
    Join Date
    03-06-2007
    Posts
    13
    I've got rid of the squares now.

    Let us know if everything is now ok with this.
    Attached Files Attached Files

+ 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