Closed Thread
Results 1 to 8 of 8

Lock Header Rows from Editing

  1. #1
    HotRod
    Guest

    Lock Header Rows from Editing

    IS there a way, either in VBA or just excel to lock the header rows (Rows
    1 -3) so that they can not be Edited or deleted?



  2. #2
    Chip Pearson
    Guest

    Re: Lock Header Rows from Editing

    Select all the cells in your worksheet, go to the Format menu,
    choose Cells, then the Protection tab. There, uncheck the Locked
    property and click OK. Now select rows 1:3, go back to the
    Protection tab, check the Protection tab, and click OK. Finally,
    go to the Tools menu, choose Protection, and Protect Sheet.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com

    "HotRod" <[email protected]> wrote in message
    news:%[email protected]...
    > IS there a way, either in VBA or just excel to lock the header
    > rows (Rows 1 -3) so that they can not be Edited or deleted?
    >




  3. #3
    HotRod
    Guest

    Re: Lock Header Rows from Editing

    I found that when I did this some of my VBA code was not working properly,
    specifically trying to change the interior ROW colour.



    "Chip Pearson" <[email protected]> wrote in message
    news:[email protected]...
    > Select all the cells in your worksheet, go to the Format menu, choose
    > Cells, then the Protection tab. There, uncheck the Locked property and
    > click OK. Now select rows 1:3, go back to the Protection tab, check the
    > Protection tab, and click OK. Finally, go to the Tools menu, choose
    > Protection, and Protect Sheet.
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    > "HotRod" <[email protected]> wrote in message
    > news:%[email protected]...
    >> IS there a way, either in VBA or just excel to lock the header rows (Rows
    >> 1 -3) so that they can not be Edited or deleted?
    >>

    >
    >




  4. #4
    Jason Clement
    Guest

    RE: Lock Header Rows from Editing

    You can protect your sheet to do this. However, cells are locked by default
    so you need to highlight the entire sheet except for the first three rows
    (you can do this by highlighting the fourth row and pressing ctrl+shift+down)
    and uncheck locked on the protection tab of cell properties. You can protect
    the sheet by accessing Tools->Protection->Protect Sheet from the menu.
    You'll get a dialog showing all the available options, and you can add a
    password which has to be entered to unlock the sheet. You should note,
    however, that if you prevent users from deleting rows (to protect the first
    three), they won't be able to delete any rows in the sheet.

    "HotRod" wrote:

    > IS there a way, either in VBA or just excel to lock the header rows (Rows
    > 1 -3) so that they can not be Edited or deleted?
    >
    >
    >


  5. #5
    HotRod
    Guest

    Re: Lock Header Rows from Editing

    What I did was highlight the whole sheet and "Unlocked" it then I
    highlighted the first three rows and "Locked" them, finally I protected the
    whole workbook. However when I ran my VBA macro it will not allow me to
    change the interior colour of a row. As soon as I unlock the sheet
    everything is fine.



  6. #6
    Dave Peterson
    Guest

    Re: Lock Header Rows from Editing

    You can modify your code to unprotect the worksheet, make the changes, then
    reprotect the worksheet.

    HotRod wrote:
    >
    > I found that when I did this some of my VBA code was not working properly,
    > specifically trying to change the interior ROW colour.
    >
    > "Chip Pearson" <[email protected]> wrote in message
    > news:[email protected]...
    > > Select all the cells in your worksheet, go to the Format menu, choose
    > > Cells, then the Protection tab. There, uncheck the Locked property and
    > > click OK. Now select rows 1:3, go back to the Protection tab, check the
    > > Protection tab, and click OK. Finally, go to the Tools menu, choose
    > > Protection, and Protect Sheet.
    > >
    > >
    > > --
    > > Cordially,
    > > Chip Pearson
    > > Microsoft MVP - Excel
    > > Pearson Software Consulting, LLC
    > > www.cpearson.com
    > >
    > > "HotRod" <[email protected]> wrote in message
    > > news:%[email protected]...
    > >> IS there a way, either in VBA or just excel to lock the header rows (Rows
    > >> 1 -3) so that they can not be Edited or deleted?
    > >>

    > >
    > >


    --

    Dave Peterson

  7. #7
    HotRod
    Guest

    Re: Lock Header Rows from Editing

    Any chance you have an example of this code to Protect and Unprotect the
    sheet???



    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > You can modify your code to unprotect the worksheet, make the changes,
    > then
    > reprotect the worksheet.
    >
    > HotRod wrote:
    >>
    >> I found that when I did this some of my VBA code was not working
    >> properly,
    >> specifically trying to change the interior ROW colour.
    >>
    >> "Chip Pearson" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Select all the cells in your worksheet, go to the Format menu, choose
    >> > Cells, then the Protection tab. There, uncheck the Locked property and
    >> > click OK. Now select rows 1:3, go back to the Protection tab, check the
    >> > Protection tab, and click OK. Finally, go to the Tools menu, choose
    >> > Protection, and Protect Sheet.
    >> >
    >> >
    >> > --
    >> > Cordially,
    >> > Chip Pearson
    >> > Microsoft MVP - Excel
    >> > Pearson Software Consulting, LLC
    >> > www.cpearson.com
    >> >
    >> > "HotRod" <[email protected]> wrote in message
    >> > news:%[email protected]...
    >> >> IS there a way, either in VBA or just excel to lock the header rows
    >> >> (Rows
    >> >> 1 -3) so that they can not be Edited or deleted?
    >> >>
    >> >
    >> >

    >
    > --
    >
    > Dave Peterson




  8. #8
    Dave Peterson
    Guest

    Re: Lock Header Rows from Editing

    Option explicit
    sub testme()
    with worksheets("Sheet99")
    .unprotect password:="topsecret"
    'do your formatting
    .protect password:="topsecret"
    end with
    end sub



    HotRod wrote:
    >
    > Any chance you have an example of this code to Protect and Unprotect the
    > sheet???
    >
    > "Dave Peterson" <[email protected]> wrote in message
    > news:[email protected]...
    > > You can modify your code to unprotect the worksheet, make the changes,
    > > then
    > > reprotect the worksheet.
    > >
    > > HotRod wrote:
    > >>
    > >> I found that when I did this some of my VBA code was not working
    > >> properly,
    > >> specifically trying to change the interior ROW colour.
    > >>
    > >> "Chip Pearson" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> > Select all the cells in your worksheet, go to the Format menu, choose
    > >> > Cells, then the Protection tab. There, uncheck the Locked property and
    > >> > click OK. Now select rows 1:3, go back to the Protection tab, check the
    > >> > Protection tab, and click OK. Finally, go to the Tools menu, choose
    > >> > Protection, and Protect Sheet.
    > >> >
    > >> >
    > >> > --
    > >> > Cordially,
    > >> > Chip Pearson
    > >> > Microsoft MVP - Excel
    > >> > Pearson Software Consulting, LLC
    > >> > www.cpearson.com
    > >> >
    > >> > "HotRod" <[email protected]> wrote in message
    > >> > news:%[email protected]...
    > >> >> IS there a way, either in VBA or just excel to lock the header rows
    > >> >> (Rows
    > >> >> 1 -3) so that they can not be Edited or deleted?
    > >> >>
    > >> >
    > >> >

    > >
    > > --
    > >
    > > Dave Peterson


    --

    Dave Peterson

Closed 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