+ Reply to Thread
Results 1 to 5 of 5

VBA - Use Cell as search criteria for Find All

  1. #1
    Registered User
    Join Date
    10-22-2015
    Location
    Oneonta, ny
    MS-Off Ver
    2010
    Posts
    30

    VBA - Use Cell as search criteria for Find All

    Hello,

    I'm new to VBA and everything I've compiled so far is from help with other Excel forum members and online Searches. I'm working on creating a Cypher in which I could use to communicate with those who have a matching Cypher key using Excel. Part of the set up process (in order for more efficient running of the cypher on a slower computer) is to run a search and paste all those search results into a column and the next results into the next column and so on and so forth. The code I have posted works so far but I need to be able to use the cells in the first row as my search criteria in order to connect the circle and have Excel automatically finish populating the search results.

    I have included the file with the original code. Go to the Srch Tab, Click Find All Button, and type in a letter. Excel will do all the work and all you have to do is go to the Srch Tab and pick another letter (one that corresponds to the next column.

    This code, instead of continuing with the 2nd Row, it ends on the first row of the column with the next search criteria I want to use. How do I get VBA to search for that particular cell it lands on and how do I get it to stop when it lands on a blank cell?

    Thanks in advance for your help.

    ~MsBBS


    Please Login or Register  to view this content.
    Sample.xlsm

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: VBA - Use Cell as search criteria for Find All

    I undersand the code, but I don't follow what you're asking.

    Quote Originally Posted by MsBBStacker View Post
    The code I have posted works so far but I need to be able to use the cells in the first row as my search criteria in order to connect the circle and have Excel automatically finish populating the search results.
    Cells in the first row of what?


    This code, instead of continuing with the 2nd Row, it ends on the first row of the column with the next search criteria I want to use. How do I get VBA to search for that particular cell it lands on and how do I get it to stop when it lands on a blank cell?
    I don't understand this part?
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    10-22-2015
    Location
    Oneonta, ny
    MS-Off Ver
    2010
    Posts
    30

    Re: VBA - Use Cell as search criteria for Find All

    Quote Originally Posted by AlphaFrog View Post
    I undersand the code, but I don't follow what you're asking.


    Cells in the first row of what?

    First Row of the "Rand" Tab. Basically the Top Cell of All Columns after E but ending on the last Column that Is Blank.



    Quote Originally Posted by AlphaFrog View Post
    I don't understand this part?
    By this, I'm talking about the very last cell that's selected when the Macro Ends. The original version of my Macro Ends in row 2 of the Column that it's in.

    What I want the code to continue to do is go to the First Cell of the Column next to it, read the contents of that cell, use those contents as the search criteria, and paste the address of all the search results in A1 of the "Search Results" Tab, have =Rand() fill from the B2 of the Search Results Tab until the last Row of the A Column that has Data, Sort Column A by Smallest to Largest of Column B, Copy only the cells in Column A with data, paste those cells starting in "Col Letter" Row 2, move one cell right and one cell up (1st Row of the Column), Use the contents of that cell as the search criteria, paste the addresses of the search results into Cell A1 of the "Search Results Tab" - and the circle of events continues until the code reaches a blank cell in the Cell of the First Row of the Column next to it.

    If you open the file I posted here; Open the Search Tab; Click the "Find All" Button; Put the letter D in the Box that appears; and hit "Enter", The code will run perfectly but it will stop in cell Y2. Cell Y1 is labeled E. Hit that Find All Button again and search for the letter "E", the code will end in Cell Z2 and Cell Z1 is already labeled F. Now, if you press "CTRL + SHIFT + F" it should run the Macro called "FindCopyAll_Alt". This will do the same exact same thing as hitting the "Find All" button except this time, it will end in cell AA1 instead of Cell AA2. AA1 has the letter G in it. I would like for this Macro to continue running by searching for that G then the H next and so on until it reaches the blank cell at location AU1.

    Thanks for the inquiry. Really having a hard time explaining it which is why I posted the File.

    ~MsBBS

  4. #4
    Registered User
    Join Date
    10-22-2015
    Location
    Oneonta, ny
    MS-Off Ver
    2010
    Posts
    30

    Re: VBA - Use Cell as search criteria for Find All

    bump up to top

  5. #5
    Registered User
    Join Date
    10-22-2015
    Location
    Oneonta, ny
    MS-Off Ver
    2010
    Posts
    30

    Re: VBA - Use Cell as search criteria for Find All

    Bump up to top

+ 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. Find and Delete rows based on cell value VBA, using a list as search criteria
    By ang374 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2015, 10:55 AM
  2. Userform search from sheet and find criteria and sum
    By konficus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2015, 10:02 AM
  3. Find data based on search criteria
    By melnahum in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-20-2015, 12:01 PM
  4. [SOLVED] Find the reuslt from two search criteria
    By Beach Walker in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-08-2014, 11:51 PM
  5. [SOLVED] Find and replace using cell contents as the search criteria
    By Vlad717 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2013, 03:58 PM
  6. [SOLVED] How to find a value with two search criteria
    By hun1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-04-2013, 04:29 AM
  7. Advance Search and GoTo a cell that meets a certain search criteria
    By moatik in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-21-2010, 04:01 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