I got VBA code that runs sql server stored proc, brings data into excel.
EX: Excel Data:
Id Division Department Scale
1 North IT 8.5
2 South Finance 8.0
3 North Finance 8.0
4 West IT 8.5
5 East Finance 8.0
6 South IT 8.5
Now I got a situation that is:
If one user from North runs the VBA macro, the excel result should only show Division North. If users from South runs VBA macro, the excel result should only show Division South.
EX: If one user from South runs VBA macro, the result like
Id Division Department Scale
2 South Finance 8.0
6 South IT 8.5
How can I setup users by Division to filter data in VBA.
I got limited No. of users mostly 4-6 users. Is there any way to use their windows credentials to filter data in excel, by adding some code in VBA?
any help?