Hi Anna
This should get you started
Sub UnHideCols()
Dim user As String
user = Environ("Username")
With Sheets("Sheet1")
' you have to leave at least 1 column visible on a sheet
' so set all but column A as hidden to begin with
Columns("B:IV").EntireColumn.Hidden = True
Select Case user
Case "Anna"
Columns("B:H").EntireColumn.Hidden = False
Case "Roger"
Columns("I:M").EntireColumn.Hidden = False
' add as many other users as you wish, with their
' relevant columns hidden property set to false
Case Else
End Select
End With
End Sub
--
Regards
Roger Govier
"anna" wrote in message
...
in my office we have a shared drived folder that is used by different
users,we store excel worksheets in the shared folder. Each user have to
log
in to the PC with a different ID to start using the it.
I need a macro to automatically hide/unhide rows in the excel worksheet
depending on who the user is.
How should i write the macro? Please help.
__________ Information from ESET Smart Security, version of virus
signature database 4801 (20100124) __________
The message was checked by ESET Smart Security.
http://www.eset.com
__________ Information from ESET Smart Security, version of virus signature database 4801 (20100124) __________
The message was checked by ESET Smart Security.
http://www.eset.com