PURPOSE:
If a specfic checkbox on a userform is checked, then it needs to look in a specific cell for a specific string on a worksheet and if found, then that row is to remain visible, and if not then then that row is to be hidden.
MY PROBLEM:
The range that it is to be searching in has already been previously filtered down on the worksheet (so I need it to be searching in only the visible rows in column "R".)
Additionally, it has to be looking for part of a string using the "Like" operator. Here is what I have so far (that obviously, doesn't even come close to working... I know that. But it does include everything that I want it to do so hopefully someone can help me with what is the correct way to have it structured or written so that it does what I am wanting it to do... of course may not be possible to do this or I am using the wrong approach to get what I am trying to get)
Once confirming that the checkbox is checked, AND the part of the string that it is searching for (which for this checkbox is: "*CSR2B *") in the cell 18 over (column R) and down to the last visible row, then that row is to remain visible and if not, then it is to be hidden.
If a specfic checkbox on a userform is checked, then it needs to look in a specific cell for a specific string on a worksheet and if found, then that row is to remain visible, and if not then then that row is to be hidden.
MY PROBLEM:
The range that it is to be searching in has already been previously filtered down on the worksheet (so I need it to be searching in only the visible rows in column "R".)
Additionally, it has to be looking for part of a string using the "Like" operator. Here is what I have so far (that obviously, doesn't even come close to working... I know that. But it does include everything that I want it to do so hopefully someone can help me with what is the correct way to have it structured or written so that it does what I am wanting it to do... of course may not be possible to do this or I am using the wrong approach to get what I am trying to get)
Once confirming that the checkbox is checked, AND the part of the string that it is searching for (which for this checkbox is: "*CSR2B *") in the cell 18 over (column R) and down to the last visible row, then that row is to remain visible and if not, then it is to be hidden.
Code:
If Me.chkCSR2B = True And Worksheets("Seatex Incident Log").Range(Cells(18, 18), Cells(rCol, 18)).SpecialCells(xlCellTypeVisible) Like "*CSR2B*" Then EntireRow = Visible Else EntireRow = Hidden
Last edited: