Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Protecting certain fields in workbook

Hi,
I have several worksheets in a workbook. These worksheets have borders that
I have protected the cell to keeps them for being removed when the
worksheets are protected.
However, these borders are being copied and pasted to other cells in the
worksheets that are not protected.
I posted a question on how to keep users from being able to select those
cells that have borders in it, and this was the solution that someone from
this newsgroup gave me:

Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.EnableSelection = xlUnlockedCells

End Sub

This is working great! But, I would like to not have any code in the
workbook... expect in the Thisworkbook module; and this code only works if I
have it in each worksheets's module.
So, my question is, is there a way to make this code or some other code work
from an addin file or in ThisWorkbook module of my current workbook?

Thanks in advance for you help!!
Kimberly


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Protecting certain fields in workbook

Kimberly,

Move the code to the Thisworkbook module and put it in the workbook open
event

Dim x as Integer
For x = 1 to Activeworkbook.Worksheets.count
Sheets(x).EnableSelection = xlUnlockedCells
Next

--
sb
"KimberlyC" wrote in message
...
Hi,
I have several worksheets in a workbook. These worksheets have borders

that
I have protected the cell to keeps them for being removed when the
worksheets are protected.
However, these borders are being copied and pasted to other cells in the
worksheets that are not protected.
I posted a question on how to keep users from being able to select those
cells that have borders in it, and this was the solution that someone from
this newsgroup gave me:

Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.EnableSelection = xlUnlockedCells

End Sub

This is working great! But, I would like to not have any code in the
workbook... expect in the Thisworkbook module; and this code only works if

I
have it in each worksheets's module.
So, my question is, is there a way to make this code or some other code

work
from an addin file or in ThisWorkbook module of my current workbook?

Thanks in advance for you help!!
Kimberly




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
Protecting a workbook Kim Excel Worksheet Functions 5 September 29th 08 06:26 PM
protecting workbook jolowe Excel Discussion (Misc queries) 2 June 8th 08 02:57 PM
Protecting a workbook Sasikiran Excel Discussion (Misc queries) 1 March 6th 08 10:05 PM
Protecting Workbook!.. Neo1 Excel Worksheet Functions 3 May 3rd 06 01:22 PM
Protecting Workbook Paul Cooling Excel Discussion (Misc queries) 2 March 7th 05 11:55 AM


All times are GMT +1. The time now is 11:05 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"