Good day,

I have the following userform that has 1 combox and 5 textboxes – I use this to search through a data sheet (which works fine) however I want to add a checkbox to the userform that once checked then you are only able to search through the “true” (which I have a column true or false) column “G”. I will add a password to this checkbox, so that not everybody would be able to view all the enters. This is the current code.

Private Sub ComboBox1_Change()

      Dim myname As String, myrange As Range
      myname = Me.ComboBox1.Text
      Set myrange = ThisWorkbook.Sheets("USER PASSWORDS").Range("a:a")
      Set found = myrange.Find(myname, LookIn:=xlValues)
      If Not found Is Nothing Then
      
          Me.TextBox6 = found.Offset(, 1)
          Me.TextBox2 = found.Offset(, 2)
          Me.TextBox3 = found.Offset(, 3)
          Me.TextBox4 = found.Offset(, 4)
          Me.TextBox5 = found.Offset(, 5)
      Else
      
          Me.TextBox2 = ""
          Me.TextBox3 = ""
          Me.TextBox4 = ""
          Me.TextBox5 = ""
          Me.TextBox6 = ""
  End If
  End Sub
The code below is what I think it should be, but also not sure where it should go Priavte Sub ComboBox1_Change() or Private Sub UserForm_Initialize()

' Dim finalrow As Long

      'Dim i As Long
      'For i = 2 To finalrow
      'If Worksheets("USER PASSWORDS").Cells(i, "g") = ("TRUE") Then
      'With Worksheets("USER PASSWORDS")
  'End With
  'End If
  'Next i
Thank you