Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
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
ShowDataForm Steve Excel Discussion (Misc queries) 0 August 15th 07 09:48 PM
Select certain values in a field, then drag it up to lock it in Schneikr Excel Worksheet Functions 0 October 16th 06 03:41 PM
Lock a field KFC Excel Discussion (Misc queries) 0 January 19th 06 07:55 AM
ShowDataForm method nc Excel Discussion (Misc queries) 4 March 8th 05 10:09 AM
ShowDataForm disabeling a field rony Excel Programming 0 October 27th 04 12:31 PM


All times are GMT +1. The time now is 10:56 AM.

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"