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

Is it possible to password protect an individual cell (rather than the whole sheet) so that some cells appear blank and if selected they prompt for a password for viewing?
Thankyou for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default password protection

Hi Matt
this is not possible with the build-in functionality in Excel. I could
imagine trying the following to achieve something similar
- format the cell with a white font color
- use the selection_change event of this worksheet:
- if this specific cell is selected ask for a password
- format the cell with a black font color if the pwd is correct
- in all other cases (other cells are selected) change the font
color to white

Note: a determined user will simply change the font color of the whole
column - no chance to prevent this if the worksheet is not protected.
So in your case I would protect the entire worksheet but lock only
these specific cells. You may add to this the selection change event
and unlock the worksheet (and therefore show the cell contents) if the
user enters this cell


--
Regards
Frank Kabel
Frankfurt, Germany

Matt wrote:
Is it possible to password protect an individual cell (rather than
the whole sheet) so that some cells appear blank and if selected
they prompt for a password for viewing? Thankyou for any help.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default password protection

Perhaps store the cell values in an xlVeryHidden worksheet
and import them if the password is correct:

Const Pwd As String = "horse"
Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
Dim Resp As Variant, myRange As Range
Set myRange = Range("A1:A10")
If Not Intersect(Target, myRange) Is Nothing Then
If Target.Count = 1 Then
Do Until Resp = Pwd
Resp = InputBox("Enter password to view cell
contents . . .", "Password Entry")
If Resp = "" Then Exit Sub
If Resp = Pwd Then
Target = Sheets("Hidden").Range
(Target.Address)
Else
MsgBox "Password failed !!! ",
vbExclamation, "Password entry"
End If
Loop
End If
End If
End Sub

Regards,
Greg

-----Original Message-----
Is it possible to password protect an individual cell

(rather than the whole sheet) so that some cells appear
blank and if selected they prompt for a password for
viewing?
Thankyou for any help.
.

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
Password protection in macro ( Anybody can view my password in VB Sherees Excel Discussion (Misc queries) 2 January 24th 10 10:05 PM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Password Protection Kiley Excel Discussion (Misc queries) 7 October 8th 09 02:25 PM
Password Protection ralph Excel Discussion (Misc queries) 2 April 17th 06 09:56 PM
Password Protection JamesD Excel Discussion (Misc queries) 1 April 7th 05 02:36 PM


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