Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Launching a Macro based on cell entry

  1. #1
    New Member
    Join Date
    May 2002
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Does anyone know if you can launch a macro based on a cell entry? For instance if a cell is equal to 3 or 9 I want the sheet sent.

  2. #2
    Board Regular
    Join Date
    Apr 2002
    Location
    Midlands, UK
    Posts
    217
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try something like :

    Public OldAdd As String

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    OldAdd = Target.Address
    End Sub

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Range(OldAdd) = Range("A1") And Range(OldAdd).Value = 3 Or Range(OldAdd).Value = 9 Then
    Application.Dialogs(xlDialogSendMail).Show
    End If
    End Sub

    You will need to put it in the sheet module ( let me know if you're not sure ).

    HTH

    Iain

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •