ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filter Excel bases on the current user (https://www.excelbanter.com/excel-programming/332510-filter-excel-bases-current-user.html)

Keith H

Filter Excel bases on the current user
 
I need to hide rows in an Excel spredsheet based on who opened it.

How can I get the user ID or login name and how can I use this information
to hide rows?

Bob Phillips[_7_]

Filter Excel bases on the current user
 
You need the network name, so use

environ("UserName")

Use like

Select Case Environ("UserName")
Case "Bob"
Rows("1:2").hidden=true
Case "Jim"
Rows("1:24").hidden=true
End Select

--
HTH

Bob Phillips

"Keith H" <Keith wrote in message
...
I need to hide rows in an Excel spredsheet based on who opened it.

How can I get the user ID or login name and how can I use this information
to hide rows?





All times are GMT +1. The time now is 03:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com