+ Reply to Thread
Results 1 to 6 of 6

Search cell range for value and return another cell value in same column

  1. #1
    Registered User
    Join Date
    06-27-2019
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    3

    Search cell range for value and return another cell value in same column

    Hi All,

    Fairly new to VBA and I have a regression test matrix in Excel with Business Processes mapped against Test Cases which perform the regression against that business process. I want to overlay a VBA form over the Excel sheet which will allow any user to filter down by the Level 1 - Level 3 process and it returns all the tests applicable to that business process. (Please see the example regression test matrix below).

    Example Regression Test Matrix:
    test_matrix.png


    Step 1: The User filters by the Level 1 Process
    test_matrix_filtered_L1.png

    Step 2: The User filters by the Level 2 process
    test_matrix_filtered_L2.png

    Step 3: The User filters by the Level 3 Process
    test_matrix_filtered_L3.png

    Step 4: The User identifies all test cases with an 'X'
    test_matrix_filtered_findX.png

    So the VBA I need help with is (and the process I think would work):

    1. Searching for all cells with an 'X' text value on the filtered sheet (so visible cell range)
    2. When an 'X' has been found, get and store the cell address of the 'X' (e.g. $D$2)
    3. Change the stored cell address's row number to 'Row 1' (e.g $D$1 - as that is where the test case name will be stored)
    4. Search for the new cell address and return the cell's text value (the Test Case name e.g. "Test 1")
    5. Add the Cell value to a listbox on a VBA form
    6. Find the next 'X' in the range

    Any help will be much appreciated!
    Last edited by randombrownman; 07-02-2019 at 03:25 AM. Reason: Solved

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Search cell range for value and return another cell value in same column

    It would be easier to help and test a possible solution if you could attach a copy of your file that includes the form with the list box.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    06-27-2019
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    3

    Re: Search cell range for value and return another cell value in same column

    Quote Originally Posted by Mumps1 View Post
    It would be easier to help and test a possible solution if you could attach a copy of your file that includes the form with the list box.
    Thanks - I have attached the Excel workbook (Test Matrix.xlsm) which contains the Test Matrix table I have put together and a VBA form (access via the VB Editor) which currently does the table filtering of the Level 1 to Level 3 process via combobox selections.

    Appreciate the help.
    Attached Files Attached Files

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Search cell range for value and return another cell value in same column

    Try the attached file. Just click the "Show Userform" button.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-27-2019
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    3

    Re: Search cell range for value and return another cell value in same column

    Quote Originally Posted by Mumps1 View Post
    Try the attached file. Just click the "Show Userform" button.
    Thank you so much! That worked perfectly.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Search cell range for value and return another cell value in same column

    My pleasure.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Search range for hits and return cell address
    By Fno in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-28-2017, 07:42 AM
  2. Search for a cell value in multiple workbooks and return a range
    By dompainter in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2013, 09:27 AM
  3. Search Range for matching value return and to active cell.
    By morbdetro in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-02-2013, 03:08 PM
  4. [SOLVED] search text of cell in a range and return the contents in the corresponding column
    By kumail in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-18-2013, 06:42 PM
  5. Search column for name and return the value in the cell to the right of it.
    By walker313 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-14-2012, 01:03 PM
  6. Replies: 2
    Last Post: 06-29-2012, 07:02 AM
  7. Replies: 4
    Last Post: 05-12-2011, 02:25 PM

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