Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 103
Default protecting cells by password

you areHi! All Expert

Is it possible to protect five or six cell with a password. I mean to say if
somebody edit or type in these cell excel ask for a password.

I dont want excel will show the warning ( The cell or chart you are trying
to change is protected and therefor read- only).

I want to show only PASSWORD Option.

Any help will be Appriciate

Hope to hear your soon

Thanks in Advance

Hardeep kanwar
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,071
Default protecting cells by password

You must use VBA for this. Copy the following macro and place it in the
sheet module of your sheet. To access that module, right-click on the sheet
tab and select View Code. "X" out of the module to return to your sheet. I
assumed that the range of cells was named "TheRng" and the password is
"ThePassword". Change these in the code as needed. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
Dim TheEntry As Variant
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("TheRng")) Is Nothing Then
Application.ScreenUpdating = False
Application.EnableEvents = False
TheEntry = Target.Value
Application.Undo
If InputBox("Please enter the password.") = "ThePassword" Then
Target.Value = TheEntry
End If
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub
"Hardeep_kanwar" wrote in message
...
you areHi! All Expert

Is it possible to protect five or six cell with a password. I mean to say
if
somebody edit or type in these cell excel ask for a password.

I dont want excel will show the warning ( The cell or chart you are trying
to change is protected and therefor read- only).

I want to show only PASSWORD Option.

Any help will be Appriciate

Hope to hear your soon

Thanks in Advance

Hardeep kanwar


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 103
Default protecting cells by password

Thanks Sir
It works Great

hardeep kanwar

"Otto Moehrbach" wrote:

You must use VBA for this. Copy the following macro and place it in the
sheet module of your sheet. To access that module, right-click on the sheet
tab and select View Code. "X" out of the module to return to your sheet. I
assumed that the range of cells was named "TheRng" and the password is
"ThePassword". Change these in the code as needed. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
Dim TheEntry As Variant
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("TheRng")) Is Nothing Then
Application.ScreenUpdating = False
Application.EnableEvents = False
TheEntry = Target.Value
Application.Undo
If InputBox("Please enter the password.") = "ThePassword" Then
Target.Value = TheEntry
End If
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub
"Hardeep_kanwar" wrote in message
...
you areHi! All Expert

Is it possible to protect five or six cell with a password. I mean to say
if
somebody edit or type in these cell excel ask for a password.

I dont want excel will show the warning ( The cell or chart you are trying
to change is protected and therefor read- only).

I want to show only PASSWORD Option.

Any help will be Appriciate

Hope to hear your soon

Thanks in Advance

Hardeep kanwar



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
Macro- not re-password protecting Roady Excel Discussion (Misc queries) 1 July 19th 08 01:05 AM
I need help password protecting a worksheet ZBelden Excel Discussion (Misc queries) 9 February 7th 08 08:49 PM
Password Protecting One Cell Erinayn Excel Discussion (Misc queries) 1 January 11th 07 08:52 PM
Password protecting a worksheet [email protected] Excel Worksheet Functions 2 October 5th 05 09:09 PM
Password Protecting Nick Excel Discussion (Misc queries) 6 June 30th 05 12:06 PM


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