Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jul 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can you run code when cells change (2002)

    I have a bit of code that I only want to run when any cell within a certain
    named range is changed. Any way to do this?

    Thanks in advance.

    Terry
    Seattle, WA

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Can you run code when cells change (2002)

    Add this in VB under thisWorksheet:
    RangeName (change as desired) is the trigger. If the changed cell is in that range, the macro will do whatever you program to occur

    Steve

    <pre>Private Sub worksheet_change(ByVal Target As Excel.Range)

    If Not Intersect(Target, Range("RangeName")) Is Nothing Then
    'Add your code here
    End If

    End Sub
    </pre>


  3. #3
    New Lounger
    Join Date
    Jul 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can you run code when cells change (2002)

    Thank you, Steve. Works beautifully!

    Terry

Posting Permissions

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