Activate user form upon condition

  • Thread starter Thread starter fishergomz
  • Start date Start date
F

fishergomz

I want to be able to activate a user form only one time. How can I d
this? Can I do this upon first entry into the sheet?

If I rely on the contents of a cell to trigger the form, how can I d
this? What I'm thinking about doing is testing a date field fo
current date and if it's not current, I want to show the user form
 
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1")) Is Nothing Then
With Target
If .Value = Date Then
Userform1.Show
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

THis is worksheet code, so put it in the worksheet code module.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top