Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default How to have errr msg pop up when user clicks on locked cell

I have locked certain cells of a worksheet and password protected the
sheet. When a user clicks on the cells i have locked i wish that a
mesage pops up telling him thath eis unauthorised to use those cells
or something equivalent - Right now the cursor merely moves back to
last used unlocked cell. can this ne done?

PS By default when i proetect a worksheet all cells are locked and
when i click on a locked cell a warning does pop up informing me to
unprotect worksheet etc but when i lock selected cells this warning
does not pop up and instead behaves as explained above

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 695
Default How to have errr msg pop up when user clicks on locked cell

Rightclick on sheet-tab and insert this in program-code window


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox ("This cell is locked")
End Sub


"perfection" skrev:

I have locked certain cells of a worksheet and password protected the
sheet. When a user clicks on the cells i have locked i wish that a
mesage pops up telling him thath eis unauthorised to use those cells
or something equivalent - Right now the cursor merely moves back to
last used unlocked cell. can this ne done?

PS By default when i proetect a worksheet all cells are locked and
when i click on a locked cell a warning does pop up informing me to
unprotect worksheet etc but when i lock selected cells this warning
does not pop up and instead behaves as explained above


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 695
Default How to have errr msg pop up when user clicks on locked cell

ups-forgot somthing use this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("A1,A5,B7,D11")) Is Nothing Then Exit Sub '
insert ur locked cells here
MsgBox ("This cell is locked")
End Sub


"excelent" skrev:

Rightclick on sheet-tab and insert this in program-code window


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox ("This cell is locked")
End Sub


"perfection" skrev:

I have locked certain cells of a worksheet and password protected the
sheet. When a user clicks on the cells i have locked i wish that a
mesage pops up telling him thath eis unauthorised to use those cells
or something equivalent - Right now the cursor merely moves back to
last used unlocked cell. can this ne done?

PS By default when i proetect a worksheet all cells are locked and
when i click on a locked cell a warning does pop up informing me to
unprotect worksheet etc but when i lock selected cells this warning
does not pop up and instead behaves as explained above


  #4   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default How to have errr msg pop up when user clicks on locked cell

Or perhaps test to see if the cell is locked and worksheet protection is
enabled?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Locked And Target.Parent.ProtectContents Then
MsgBox "Cell is locked"
End If
End Sub

"excelent" wrote:

ups-forgot somthing use this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("A1,A5,B7,D11")) Is Nothing Then Exit Sub '
insert ur locked cells here
MsgBox ("This cell is locked")
End Sub


"excelent" skrev:

Rightclick on sheet-tab and insert this in program-code window


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox ("This cell is locked")
End Sub


"perfection" skrev:

I have locked certain cells of a worksheet and password protected the
sheet. When a user clicks on the cells i have locked i wish that a
mesage pops up telling him thath eis unauthorised to use those cells
or something equivalent - Right now the cursor merely moves back to
last used unlocked cell. can this ne done?

PS By default when i proetect a worksheet all cells are locked and
when i click on a locked cell a warning does pop up informing me to
unprotect worksheet etc but when i lock selected cells this warning
does not pop up and instead behaves as explained above


  #5   Report Post  
Junior Member
 
Location: Winters CA
Posts: 22
Default

Have you used the EnableSelection property? It allows you to control the selection behaviour of a protected worksheet
Code:
Worksheets("sheet1").EnableSelection = xlNoSelection
xlNoRestrictions and xlUnlockedCells are the other choices.
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
call excelsheet within excelsheet when user clicks excelsheet ico mohini Excel Worksheet Functions 0 November 20th 06 05:07 AM
How can user move in locked worksheet but not copy cell contents? PAT Excel Worksheet Functions 0 April 25th 06 08:40 PM
Locked by User donnaK Excel Discussion (Misc queries) 3 February 8th 06 02:38 PM
Open an Outlook folder when a user clicks on a command button ... Rob Keel Excel Discussion (Misc queries) 2 August 1st 05 08:23 AM
excel locked by another user=myself bbxrider Setting up and Configuration of Excel 3 April 29th 05 08:10 PM


All times are GMT +1. The time now is 10:18 PM.

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"