I'm using a find statement to locate a text string in a column but I get a 'type mismatch' error when I run it. I'm guessing that it's because of what I'm trying to find is a text and it is looking for a number. Anyway to point to the row number of where I find the macthing text in the column?
'Dimension variables used in Macro. Dim Logon As String Dim Level As String Dim RangeFind As Range Set RangeFind = Nothing On Error GoTo Error 'Start Access verification Logon = Environ("USERNAME") Worksheets("Main").Select Set RangeFind = ActiveSheet.Columns("S:S").Find(What:=Logon, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False) If RangeFind Is Nothing Then MsgBox "You do not have Access to this WorkBook / WorkSheet", vbOKOnly, "No Access!" Set RangeFind = Nothing Exit Sub End If RangeFind.Activate Level = ActiveCell.Offset(0, 2)
the above code works great when what i'm trying to find is a number