Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro- not re-password protecting | Excel Discussion (Misc queries) | |||
I need help password protecting a worksheet | Excel Discussion (Misc queries) | |||
Password Protecting One Cell | Excel Discussion (Misc queries) | |||
Password protecting a worksheet | Excel Worksheet Functions | |||
Password Protecting | Excel Discussion (Misc queries) |