Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default protect cells

I have a macro that creates subtotals. I want to protect
several cells to the right of the subtotal so the user can
be prevented from entering any data in them.

I'm looking for suggestions how to accomplish this.
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default protect cells

Hi
- select all cells
- goto 'Format - Cells - Protection' and uncheck 'Locked'

Now in your macro:
- set the .locked property of these cells to 'True'
- protect the sheet (e.g. activesheet.protect)



--
Regards
Frank Kabel
Frankfurt, Germany

"JT" schrieb im Newsbeitrag
...
I have a macro that creates subtotals. I want to protect
several cells to the right of the subtotal so the user can
be prevented from entering any data in them.

I'm looking for suggestions how to accomplish this.
Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default protect cells

ActiveSheet.Unprotect
Cells.Locked = False
for each cell in Range("B4:B800")
if instr(1,cell.Text,"Subtotal",vbTextCompare) 0 then
cell.offset(0,1).Resize(1,10).Locked = True
end if
Next
Activesheet.Protect

--
Regards,
Tom Ogilvy

"JT" wrote in message
...
I have a macro that creates subtotals. I want to protect
several cells to the right of the subtotal so the user can
be prevented from entering any data in them.

I'm looking for suggestions how to accomplish this.
Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
M M is offline
external usenet poster
 
Posts: 18
Default protect cells

Lock the entire sheet, then Unlock the cells you want
people to be able to enter information into then protect
the sheet. This will allow the user to only enter data in
cells you want them to use.

-----Original Message-----
I have a macro that creates subtotals. I want to protect
several cells to the right of the subtotal so the user

can
be prevented from entering any data in them.

I'm looking for suggestions how to accomplish this.
Thanks.
.

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
Protect Cells juanpablo Excel Discussion (Misc queries) 10 April 30th 10 02:47 PM
protect cells in excel, but also allow a search in those cells? LindaAlex Excel Worksheet Functions 2 January 28th 10 02:51 PM
How do I protect cells or a range of cells in excel spreadsheet? Abundance Excel Worksheet Functions 1 July 28th 09 11:03 PM
Protect Only Certain Cells bgcooker Excel Discussion (Misc queries) 2 March 25th 09 03:38 PM
Protect only certain Cells? Katee Excel Discussion (Misc queries) 3 January 27th 07 05:40 PM


All times are GMT +1. The time now is 03:00 AM.

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

About Us

"It's about Microsoft Excel"