Atiqul Haque
New Member
- Joined
- Dec 13, 2020
- Messages
- 45
- Office Version
- 2016
- Platform
- Windows
Problem#1
Expand/Collapse groups in protected Worksheets:
When i put the following vba codes, it works only for one protected worksheet. But i need it for several protected worksheets.
Pls help someone to solve this issue. Your help will be highly appreciated.
Thanks in advance.
In a standard Module:
In ThisWorkbook:
Problem#2
I need to Add Username in a fixed cell of a worksheet when a user login by Login Interface.
Expand/Collapse groups in protected Worksheets:
When i put the following vba codes, it works only for one protected worksheet. But i need it for several protected worksheets.
Pls help someone to solve this issue. Your help will be highly appreciated.
Thanks in advance.
In a standard Module:
VBA Code:
Sub protect_sheet()
ActiveSheet.Unprotect "639"
Dim Sh As Worksheet
Set Sh = ThisWorkbook.Sheets("CBC_Report")
Sh.Protect "639", userinterfaceonly:=True
Sh.EnableOutlining = True
ActiveSheet.Protect "639"
End Sub
In ThisWorkbook:
VBA Code:
Private Sub Workbook_Open()
Dim Sh As Worksheet
Set Sh = ThisWorkbook.Sheets("CBC_Report")
Sh.Protect "639", userinterfaceonly:=True
Sh.EnableOutlining = True
End Sub
Problem#2
I need to Add Username in a fixed cell of a worksheet when a user login by Login Interface.
Last edited by a moderator: