Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default 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" wrote in message
...
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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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" wrote in message
...
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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Lock Header Rows from Editing

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



"Dave Peterson" wrote in message
...
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" wrote in message
...
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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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" wrote in message
...
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" wrote in message
...
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" wrote in message
...
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy cells but lock editing Lise Excel Discussion (Misc queries) 5 April 15th 10 12:39 PM
lock for editing des-sa[_2_] Excel Discussion (Misc queries) 3 January 15th 09 09:01 PM
lock for editing des-sa[_2_] Excel Discussion (Misc queries) 0 January 15th 09 06:01 PM
How do I lock some fields but allow editing for others in excel S.Sharif Excel Discussion (Misc queries) 1 December 13th 05 02:58 AM
lock cells for editing-pawan Pawan Excel Programming 1 June 28th 05 02:01 PM


All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"