Results 1 to 3 of 3

Thread: [RESOLVED] Excel change event not working

  1. #1
    New Member
    Join Date
    Sep 12
    Posts
    2

    Resolved [RESOLVED] Excel change event not working

    I am trying to have a macro run when a cell cell is changed to an integer value of 1, 2 or 3. When I am running the code the macro is running when I select a cell of value 1, 2 or 3 and not when changing the cell value. Any help is greatly appreciated.

    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Not Application.Intersect(Target, Range("C:M")) Is Nothing Then
            If Target.Value > 0 And Target.Value < 4 Then
                Call macro  'macro that should function
            End If
        End If
    End Sub

  2. #2
    Addicted Member
    Join Date
    Jul 08
    Location
    Colorado
    Posts
    187

    Re: Excel change event not working

    Try "Worksheet_Change" instead of "Worksheet_SelectionChange". SelectionChange triggers when you select something else. Change triggers when you change a cell.

  3. #3
    New Member
    Join Date
    Sep 12
    Posts
    2

    Re: Excel change event not working

    That is all that was needed. Thank you so much!

Posting Permissions

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