Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Expand/Collapse columns on password protected worksheets

This is a discussion on Expand/Collapse columns on password protected worksheets within the Excel Questions forums, part of the Question Forums category; Is there a way to password protect a document AND still allow for a user to expand or collapse columns? ...

  1. #1
    Board Regular
    Join Date
    Apr 2003
    Posts
    81

    Default Expand/Collapse columns on password protected worksheets

    Is there a way to password protect a document AND still allow for a user to expand or collapse columns?

    Currently, it appear that when a worksheet is password protected, one cannot expand or collapse a column.

    Thank you,

    Dalex.

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,948

    Default

    You mean changing the column width ? no, not without a macro to "simulate" that... or use Excel XP.
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    Board Regular
    Join Date
    Apr 2003
    Posts
    81

    Default

    Thanks for response. I don't want to change the size of the columns, I just want to be able to click on the "plus" sign to expand them out. This doesn't change the column width..does it?

    Also, I am currently on XP.

    Thanks

  4. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,948

    Default

    Right, I thought XP had that option in the protection, but not...

    Ok then, let's use the same trick that works to enable the autofilter in previous versions. Put this in the Workbook module, and change the sheet (And password if you need to)


    Private Sub Workbook_Open()
    ****With Sheets("Sheet1")
    ********.Protect "password", , , , True
    ********.EnableOutlining = True
    ****End With
    End Sub
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  5. #5
    Board Regular
    Join Date
    Apr 2003
    Posts
    81

    Default

    Thanks,I'll give it a shot and let you know. I'm sort of new to entering code so if you can give me more baby steps I would be very thankful. :)

    Dalex

  6. #6
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,948

    Default

    Look here for a small example:

    http://www.mrexcel.com/tip038.shtml

    but instead of inserting a new module, double click on the "ThisWorkbook" icon that you should see in the project explorer.
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  7. #7
    Board Regular
    Join Date
    Apr 2003
    Posts
    81

    Default

    Hello,

    I typed in the formula in "This workbook" as you suggested, but it did not expand as expected. Please note that I am looking to expand rows and columns. Does this change the code? Also, am I to fill in the ", , , " part of the code with something?

    Thank you

    Dalex

  8. #8
    Board Regular
    Join Date
    Apr 2003
    Posts
    81

    Default Re: Expand/Collapse columns on password protected worksheets

    I've entered the code but am not getting the desired reults. Any additional thoughts.

    Perhaps I'm not entering the code correctly.

    FYI - I'm looking to do this to a worksheet and not a workbook.

  9. #9
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,948

    Default Re: Expand/Collapse columns on password protected worksheets

    Ok, follow me on this steps.

    Open Excel
    Open the workbook that you want
    Right click the little workbook icon that is on the LEFT of the File menu
    Choose "View code" in there.
    Paste the entire code that I gave you, just as it is.

    The ONLY thing that you may need to change is the "Sheet1" with the name of the sheet that you want, and "password" with the password that you're using to protect the sheet.

    After that, go back to Excel, save the workbook, close it, and open it again.
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  10. #10
    Board Regular
    Join Date
    Apr 2003
    Posts
    81

    Default Re: Expand/Collapse columns on password protected worksheets

    It worked. Thank you. I guess I needed some hand holding.

    Thank you, this capability makes my project great! You have helped metremendously!

    Dalex

Page 1 of 2 12 LastLast

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com