+ Reply to Thread
Results 1 to 2 of 2

is it possible to use macros when the sheet is protected

  1. #1
    Dajana
    Guest

    is it possible to use macros when the sheet is protected

    My sheet is protected but still I am able to paste information into cells.
    However I have written a macro that allows me to change the size of the row
    if the size of the text is bigger than the size of the cell. It seems
    however that I am unable to use this feature when the sheet is protected. Is
    there a way to solve this problem and use this macro when the sheet is
    protected.

    Thanks

  2. #2
    Dave Peterson
    Guest

    Re: is it possible to use macros when the sheet is protected

    In xl2002+, you can allow formatting (including rowheight) when you protect the
    worksheet.

    You could also protect the sheet in code and tell xl you want to let macros
    change things on that protected worksheet.

    Option Explicit
    Sub auto_open()
    With Worksheets("sheet1")
    .Protect Password:="hi", userinterfaceonly:=True
    End With
    End Sub

    It needs to be reset each time you open the workbook. (excel doesn't remember
    it after closing the workbook.)

    If you're new to macros, you may want to read David McRitchie's intro at:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    Or you could just add some code to unprotect the worksheet, change the
    rowheight, then reprotect the worksheet.

    Dajana wrote:
    >
    > My sheet is protected but still I am able to paste information into cells.
    > However I have written a macro that allows me to change the size of the row
    > if the size of the text is bigger than the size of the cell. It seems
    > however that I am unable to use this feature when the sheet is protected. Is
    > there a way to solve this problem and use this macro when the sheet is
    > protected.
    >
    > Thanks


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1