Good morning all. I have a working macro below that filters column E according to the username of a person.
I would however like to add a second criteria into the mix that effectively says to filter by column E or F. For example, it may be that my username is in Column F but not E, or vice versa, and then filter accordingly.
Is that too tricky to achieve?
Thanks in advance!
I would however like to add a second criteria into the mix that effectively says to filter by column E or F. For example, it may be that my username is in Column F but not E, or vice versa, and then filter accordingly.
Is that too tricky to achieve?
Thanks in advance!
Code:
Sub Users_Fullname()
Dim objInfo
Dim strLDAP
Dim strFullName
Dim LR
Set objInfo = CreateObject("ADSystemInfo")
strLDAP = objInfo.UserName
Set objInfo = Nothing
strFullName = GetUserName(strLDAP)
'MsgBox "Full name of User is " & strFullName (step to test)
'filter
With Sheets("All KPIs - all columns")
LR = .Cells(.Rows.Count, 2).End(xlUp).Row
.Cells(2, 5).AutoFilter Field:=5, Criteria1:=strFullName
End With
End Sub