LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Cell Input Monitoring

You can use the Worksheet_Change event procedure. In the VBA editor, view
the project explorer and double-click on the worksheet you are using. Then
in the code pane type this code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim TestCell As Range, Invalid As Boolean
If Not (Intersect(Target, Range("H9:J400")) Is Nothing) Then
For Each TestCell In Target.Cells
Invalid = Invalid Or TestCell.Value < "X"
Next TestCell
End If
If Invalid Then
MsgBox "You must enter 'X' here"
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
End If
End Sub

--
- K Dales


"parteegolfer" wrote:


I am looking to only allow an "X" be entered in Columns H9:H400,I9:I400
and J9:J400. If anything else is inserted in any of these cells a
Message box will pop up stating only an "X" can be entered in this
cell.

Any Ideas?

Thanks in advance!:)


--
parteegolfer
------------------------------------------------------------------------
parteegolfer's Profile: http://www.excelforum.com/member.php...o&userid=31951
View this thread: http://www.excelforum.com/showthread...hreadid=521816


 
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
How to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
monitoring links mohavv Excel Discussion (Misc queries) 0 December 8th 08 12:36 AM
monitoring use Sanford Lefkowitz Excel Discussion (Misc queries) 3 October 20th 06 08:47 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
Monitoring Changes teresa Excel Programming 2 December 13th 04 03:48 PM


All times are GMT +1. The time now is 03:50 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"