Worksheet_Change?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value = "Oranges" Then
UserForm1.Show
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub
Gord Dibben MS Excel MVP
On Fri, 28 May 2010 07:29:02 -0700, spreadsheetlady
wrote:
Hi,
I'm trying to automatically open a Form when a target cell contains an exact
text.
Example:
IF cell A1 says: "Oranges"
THEN
Open Form1.
I've only opened Forms using command buttons.
I was thinking maybe using Sub Worksheet_Change to do this?
If cell A1 says anything else, (false) Do not open Form1.
Thank-you in advance
Amy
|