+ Reply to Thread
Results 1 to 2 of 2

Worksheet change macro on a change in a specific cell

  1. #1
    Registered User
    Join Date
    11-17-2009
    Location
    Grand Rapids, MI
    MS-Off Ver
    Office 2010
    Posts
    7

    Worksheet change macro on a change in a specific cell

    I want a macro to run if and only if one cell changes. I only want it to run only if cell B2 changes. The macro I have written runs on any change in any cell on the sheet. Any suggestions?

    Private Sub Worksheet_Change(ByVal Target As Range)
    On Error Resume Next
    If Not Intersect(Target, Range("B2")) Is Nothing Then
    End If
    Call Macro2
    Call Macro3
    Call Macro4
    Call Macro5
    Call Macro6
    Call Fix_Circular_Reference
    End Sub

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Worksheet change macro on a change in a specific cell

    Notice that you have an "End If" immediately following the IF... line; therefore, the if..end if lines do nothing. The code to execute must be between the IF... End If lines.
    All you really have is:
    On Error Resume Next
    Call Macro2 ...
    Last edited by protonLeah; 06-07-2012 at 06:29 PM.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1