Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I posted a question earlier this week about how to force a user to enter data
in a cell. Gary''s Student - gsnu200775 provided the following reply: "Put the following line in a standard module: Public checkit As Boolean Put the following worksheet event macro in the worksheet code area: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set b9 = Range("B9") Set t = Target If Intersect(t, b9) Is Nothing Then If checkit Then If b9.Value = "" Then Application.EnableEvents = False b9.Select Application.EnableEvents = True Else checkit = False End If End If Else checkit = True End If End Sub" Which works beautifully!! Thank you Gary. However I have two more questions: 1. How do I change the code to provide an error message to the user that they have to enter data in the cell 2. How do I change the range so that I can say force data entry for all column 'B' cells from row 9 - row 50. Any help would be greatly appreciated!!! Cindy Butler |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Okay -
I have answered question 1. I still need some help with question 2: 2. How do I change the range so that I can say force data entry for all column 'B' cells from row 9 - row 50. Thanks - Cindy "CindyB" wrote: I posted a question earlier this week about how to force a user to enter data in a cell. Gary''s Student - gsnu200775 provided the following reply: "Put the following line in a standard module: Public checkit As Boolean Put the following worksheet event macro in the worksheet code area: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set b9 = Range("B9") Set t = Target If Intersect(t, b9) Is Nothing Then If checkit Then If b9.Value = "" Then Application.EnableEvents = False b9.Select Application.EnableEvents = True Else checkit = False End If End If Else checkit = True End If End Sub" Which works beautifully!! Thank you Gary. However I have two more questions: 1. How do I change the code to provide an error message to the user that they have to enter data in the cell 2. How do I change the range so that I can say force data entry for all column 'B' cells from row 9 - row 50. Any help would be greatly appreciated!!! Cindy Butler |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Force an entry | Excel Discussion (Misc queries) | |||
Use Validation to force specific entry of first 3 characters in st | Excel Worksheet Functions | |||
Validation to force entry in a cell | Excel Worksheet Functions | |||
Force entry to one of three cells | Excel Worksheet Functions | |||
Data entry error | Excel Worksheet Functions |