binaya shahi
New Member
- Joined
- Oct 28, 2022
- Messages
- 3
- Office Version
- 2016
- Platform
- Windows
running sub-procedure from button malfunctions but running it from vba editor works fine?
this problem started when i protected all worksheet.
I wrote the following code to unprotect all the sheets at the beginning of sub-procedure
and again protect all worksheet in the end of sub-procedure.
Please help!
sub name()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect
code
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect
end sub
this problem started when i protected all worksheet.
I wrote the following code to unprotect all the sheets at the beginning of sub-procedure
and again protect all worksheet in the end of sub-procedure.
Please help!
sub name()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect
code
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect
end sub