Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger code when a Cell is entered with a specific Value

Status
Not open for further replies.

davefish

Technical User
Jul 26, 2002
169
GB
I have read thread707-938434 and this is very good at triggering a piece of code when exitiing a cell. However, what I'm trying to do is trigger code on entering a specific value in a field from list. The code within the trigger would only be as shown below

If [C10].Value = "Guest" Then
Guest_Form.Show

End If
Guest form then allows a user to enter name and department, which is then in turn used in a differnet sheet. Unfortunatley I cannot get code to work when a cell has focus. Can aynone help?
 

hi,

in the Sheet Code Window (right-click the sheet tab and select View Code), paste this code...
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If not intersect(target, [C10]) is nothing then
  if target.value = "Guest" Then _
     Guest_Form.Show
end if
End Sub

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top