Forum Discussion
lfk73
Jul 13, 2022Brass Contributor
Share link to excel in SharePoint with filters applied
I have a large spreadsheet that has a column with people names. This file is stored in SharePoint. The idea would be I share the link to each person who appears in the name column and they filter f...
ecovonrein
Jul 16, 2022Iron Contributor
I don't really understand the challenge but it is easy enough to write a VBA function that returns the username. Something like
Public Function vbUserName() As Variant
vbUserName = Application.UserName
End Function
That might help you with the auto-filter. For example, you could stick that function into Auto_Open to hide all rows that do not match that name.
Public Function vbUserName() As Variant
vbUserName = Application.UserName
End Function
That might help you with the auto-filter. For example, you could stick that function into Auto_Open to hide all rows that do not match that name.
- lfk73Jul 20, 2022Brass Contributor
ecovonrein Thanks for the suggestion. Unfortunately the format of the username the code will return won't match the format of the name column that I want to apply the filter automatically.
- ecovonreinJul 20, 2022Iron ContributorHard luck. There are only two answers. 1) Update your database to reflect Window's perception of the users' names; or 2) create another database of aliases that maps your name to Window's name. You cannot expect to find a second token that matches your database unless perhaps the database was generated from those tokens in the first place.
Another option might be to try fuzzy logic, like the credit card processors or Google do, eg count the characters that match between the two. If >90%, assume a hit. That sort of thing.