VBA - How to exclude rows from search results if a cell is = to a specific value

  • Hey all,


    I am wanting to exclude certain results from my search if one of the cells value is Completed and Cancelled.

    I have managed to find some code that loops through my list looking for rows with a certain value, i just don't know how to make it exclude the rows with the above values.


    Status1 & Status2 are the values i am trying to ignore. They are located in column 15 on the "DataBaseTasks" sheet.


    Below is my code:

  • Ok have attached my project. This is my first project in VBA, so i have been learning as i go along.


    The above code is located on the CheckScaleForm


    It is used to search DataBaseTasks sheet to create a list of Tasks related to the specific mine on separate sheets. I want the code to only show tasks that aren't Cancelled or Completed in these list boxes.


    Those sheets then are used for the 3 of my list boxes to display the tasks for that mine.

    You can then double click an a task and write a record for it and save it. Depending on your choices it may generate an email.


    There is an error popping up to but i will ask for help about that after this is sorted. One problem at a time. I have managed to get this far on my own. My code may not be pretty but it mostly works.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!