Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.
Private Sub cmbFind_Click() Dim strFind As String 'what to find Dim FirstAddress As String Dim rSearch As Range 'range to search Set rSearch = workstn.Range("bf7", Range("bf65536").End(xlUp)) Dim f As Integer strFind = Me.unmtxt.Value 'what to look for With rSearch Set c = .Find(strFind, LookIn:=xlValues) If Not c Is Nothing Then 'found it workstn.Rows(c.Row).Select With Me 'load entry to form .proftxt.Value = c.Offset(0, 1).Value .typetxt.Value = c.Offset(0, 2).Value .descritxt.Value = c.Offset(0, 3).Value .detailtxt.Value = c.Offset(0, 4).Value .versiontxt.Value = c.Offset(0, 5).Value .locationtxt.Value = c.Offset(0, 6).Value .cmbAmend.Enabled = True 'allow amendment or .cmbDelete.Enabled = True 'allow record deletion f = 0 End With FirstAddress = c.Address Do f = f + 1 'count number of matching records Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address <> FirstAddress If f > 1 Then Select Case MsgBox("There are " & f & " instances of " & strFind, vbOKCancel Or vbExclamation Or vbDefaultButton1, "Multiple entries") Case vbOK FindAll Case vbCancel 'do nothing End Select Me.Height = frmMax End If Else: MsgBox strFind & " doesn't seem to be on the list. You may have to use a different name" 'search failed End If End With If workstn.AutoFilterMode Then workstn.Range("Bf9").AutoFilter End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.