+ Reply to Thread
Results 1 to 9 of 9

Adding 16 vba buttons/macro to filter data fields?

  1. #1
    Registered User
    Join Date
    04-25-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    91

    Adding 16 vba buttons/macro to filter data fields?

    Hi there,

    This is my first post in this forum, and I'm afraid I think it is a difficult one. I would be really grateful for anyone's help on this. Please note that I am a complete novice with Excel and would be totally grateful for babyfed answers!

    Let me explain briefly the background to my question and what I am trying to achieve.

    BACKGROUND

    1) I have an excel spreadsheet, which runs to about 12 pages, containing a lot of data. (It is actually within table format in Word, but I will need to transfer this all to Excel).

    2) There are 85 rows within the entire spreadsheet.

    3) There are only 4 columns used in total, these columns are called 1, 2, 3, and 4. The data cells, under each column heading, contain different combinations of the words Big, Medium, Small, Micro. (Eg, Big/Big/Small/Small or Medium/Medium/Medium/Medium. You get the idea, but there are also other words/symbols contained within each cell.) .

    4) Within each row, only 4 cells are used, which contain the one of the words Big/Small/Medium/Micro (along with other data). Each of the 4 cells are under the column headings 1, 2, 3 and 4.

    5) Each of the 85 rows (and thus the 4 cells within each row ) within the spreadsheet contain a mix of data – words and numbers. So, row one could contain the data words "Big, Big, Medium ,Small , " , row two could be, "Medium,Medium,Small,Big," row three could be "Micro,Big,Small,Medium" etc.

    AIM

    If I client says to me, what is the answer to the combination "Big/Micro/Small/Medium", I have to scroll through 12 pages of excel spreadsheet to find the row with that specific combination and this can take ages!

    6) I was therefore wondering if it is possible, at the top of the spreadsheet to include buttons or some kind of macro to make finding this information quicker, whereby I can click on a specific combination of buttons (which represent the specific combination requested), which will then output the content of the entire relevant row (all 4 cells) in the "Answer Cell", as illustrated below? (Please note - the output doesn't have to be within one cell - I am open to other suggestions as to how to display the content of the 4 relevant data cells at the top of the spreadsheet).

    I set out below how I would like these buttons to look at the top of the spreadsheet. The "xs" are meant to be buttons!

    There will only ever be one applicable data row, depending on the specific combination of the 4 buttons I push, and thus the relevant row would need to be displayed where the italic word "answer" is written, ie just within one cell, right at the top of the spreadsheet, as illustrated below. It doesn't matter how wide this answer cell needs to stretch to accommodate the data.

    Apologies that the formatting goes off in the below diagram. There are 5 columns listed here. The first 4 columns each contain the buttons headed "Big/Medium/Small/Micro" and the 5th column is meant to be the answer cell.


    1 2 3 4
    X Big X Big X Big X Big Answer cell!
    X Medium X Medium X Medium X Medium
    X Small X Small X Small X Small
    X Micro X Micro X Micro X Micro



    Thus, if the client says what is the answer to the combination "Small/Small/Small/Small", I could click the 4 buttons which each represent the word "small" (in cells A4/B4/C4/D4, as I have tried to represent in the diagram above), which would automatically locate the specific row within the data section of the excel spreadsheet, and would thus spit the entire contents of that row into the answer cell, at E2.

    Is this possible?!

    Any help and guidance would be very much appreciated.
    Last edited by pagination1; 04-25-2012 at 04:27 PM.

  2. #2
    Registered User
    Join Date
    04-25-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Very Complicated 1st Excel Question?

    Just thinking about the answer cell - this sounds like it might be a bit difficult to manage.

    What if the relevant row could be displayed in its entirety, in a specified row? Eg, a row just below the buttons?

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Very Complicated 1st Excel Question?

    perhaps it would be easier to visualize if you uploaded a sample?

    are the words (big/small etc) always in the same sequence, or could they be mixed around (small/medium/large...medium/large/small)?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    04-25-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Very Complicated 1st Excel Question?

    Hi there and thanks for your response.

    I have attached 1 page of the sample data. It may look complicated, but you will see that each of the 4 cells per row include a combination of the words Big/Medium/Small/Medium (etc) - along with a lot of other data contained within each cell.

    This needs to be put in excel.

    What I want to do, is to be able to select, using the buttons I discussed, for example, the combination Big/Big/Small/Small, which will extract (for the purposes of this example) the
    data in row 2 of the attached document, and reproduce it in another row of my choosing.

    As you will see, and to answer your question, the words Big/small etc are not always in the same sequence and can be mixed around.

    Perhaps there is some way of encoding each cell in the background with the word "Big or small or medium or Micro", as appropriate, which would make it easier for excel to find.

    Perhaps using some IF equation for the VBA buttons? I.e if the value in column 1 is "Big" (ignore all other values in column 1) AND if the value in column 2 is "Small" ignore all other values in column 2 AND if the value in column 3 in "Medium" ignore all other values, etc, until you have inputted the specific combination, using the buttons, which thus locates the relevant row in the data area, and duplicates this row in another row of my choosing (ie, just below the buttons!).

    I hope this is clearer?
    Attached Files Attached Files
    Last edited by pagination1; 04-25-2012 at 11:45 AM.

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Very Complicated 1st Excel Question?

    pagination1
    You should read the forum rules (especially rule #1) and amend your title before mods come along.

  6. #6
    Registered User
    Join Date
    04-25-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Very Complicated 1st Excel Question?

    Quote Originally Posted by Cutter View Post
    pagination1
    You should read the forum rules (especially rule #1) and amend your title before mods come along.
    Thanks for the advice - the problem I have, given I am an excel novice, is that I don't know how to describe (using excel terminology), what it is I need help with!

    I shall try and amend the title tho!

  7. #7
    Registered User
    Join Date
    04-25-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Very Complicated 1st Excel Question?

    I would be really grateful if someone could also let me know how to change the thread title! I really don't want the mods to delete this thread as I am a genuine new user, who really wants to learn how to do the above.

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Very Complicated 1st Excel Question?

    The instructions for that are right in the forum rules - rule #1 - the bold text before you get to rule #2.

  9. #9
    Registered User
    Join Date
    04-25-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Very Complicated 1st Excel Question?

    Quote Originally Posted by Cutter View Post
    The instructions for that are right in the forum rules - rule #1 - the bold text before you get to rule #2.
    Lol - thank you for politely telling me to read the flipping forum rules! Now read - many thanks.

    Any solutions to my problem from anyone? I'd be grateful for all thoughts.

+ 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