LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default How to force data entry with error messages

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


 
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
Force an entry RKFLattop Excel Discussion (Misc queries) 2 October 16th 06 09:54 PM
Use Validation to force specific entry of first 3 characters in st ron Excel Worksheet Functions 4 February 15th 06 08:09 PM
Validation to force entry in a cell Matt D Francis Excel Worksheet Functions 4 October 4th 05 02:38 PM
Force entry to one of three cells Martin Smith Excel Worksheet Functions 2 May 27th 05 09:52 AM
Data entry error Kevin W Excel Worksheet Functions 1 January 7th 05 07:48 PM


All times are GMT +1. The time now is 08:30 PM.

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"