Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I'm brand new to Macros, so bear with me. I have a workbook that will have some protected and unprotected sheets. One sheet is in a table format, where columns are grouped. Upon protecting the sheet, and attempting to expand the columns provides an error. Thus the following logic was added.
Sub Auto_Open() Application.ScreenUpdating = False For Each ws In Sheets With ws .Unprotect Password:="XXXXadmin" .Protect Password:="XXXXadmin", UserInterfaceOnly:=True .EnableOutlining = True End With Next ws Application.ScreenUpdating = True End Sub Allowing me to collapse and expand columns, until I started tinkering with protected sheets and changing passwords (outside of the Macro). Now I consistently get a Run-time error '1004'. Password you supplied is not correct... Two questions - 1) does the XXXXadmin password in the Macro above have to match the sheet or workbook protection password YYYYadmin? - I've tried both and neither work 2) Can I run this subroutine just on one sheet? I don't have grouping any where else. Any help greatly appreciated and needed! Last edited by Coyoteman : April 4th 16 at 10:53 PM |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
More Assistance Needed with Pivot Tables | Excel Discussion (Misc queries) | |||
VBA assistance - Summing by grouping | Excel Discussion (Misc queries) | |||
VBA Assistance Needed | Excel Discussion (Misc queries) | |||
Macro assistance needed | Excel Programming | |||
Assistance Needed with Comparing | Excel Programming |