Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ShowDataForm how to lock a field ?
Hello all , I want to prompt the user a form in which on of the field is disable meaning locked. so I will seen as form like a drop list where the user could insert data according to one field that is locked. where "testRight" is the sub range of fields that I want to remain locked "testLeft" is the sub range of fields that I want to remain locked "SubForm" the hole form which includes the headings "testAll " is the range of all the form I want to deal with for example I got this code : Sub Macro5() ' ' Macro5 Macro ' Macro recorded 27/10/2004 by rony ' ' Keyboard Shortcut: Ctrl+r ' Dim rngDatabaseForUserForm As Excel.Range ActiveSheet.Unprotect With ActiveSheet.Range("testRight") .Locked = False End With Selection.FormulaHidden = False With ActiveSheet.Range("SubTest") .Interior.ColorIndex = 45 .Interior.Pattern = xlSolid .Interior.PatternColorIndex = xlAutomatic End With ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True Set rngDatabaseForUserForm = ActiveSheet.Range("SubTest_UserForm") rngDatabaseForUserForm.Name = "Database" ActiveSheet.ShowDataForm ActiveSheet.Unprotect With ActiveSheet.Range("testRight") .Locked = True .FormulaHidden = False End With ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True End Sub can any one help me with this ?? Rony |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ShowDataForm | Excel Discussion (Misc queries) | |||
Select certain values in a field, then drag it up to lock it in | Excel Worksheet Functions | |||
Lock a field | Excel Discussion (Misc queries) | |||
ShowDataForm method | Excel Discussion (Misc queries) | |||
ShowDataForm disabeling a field | Excel Programming |