Results 1 to 4 of 4

Run a macro when a change occurs in a range of cells (two macros and two cell ranges)

Threaded View

zanguard80 Run a macro when a change... 02-03-2014, 07:00 AM
LJMetzger Re: Run a macro when a change... 02-03-2014, 07:04 AM
:) Sixthsense :) Re: Run a macro when a change... 02-03-2014, 07:04 AM
zanguard80 Re: Run a macro when a change... 02-03-2014, 07:11 AM
  1. #1
    Registered User
    Join Date
    02-02-2014
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    37

    Run a macro when a change occurs in a range of cells (two macros and two cell ranges)

    I'm using this code to run a macro whenever data is entered/removed from a cell within a range.

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim KeyCells As Range
    
    Set KeyCells = Range("M3:M52")
    
    If Not Application.Intersect(KeyCells, Range(Target.Address)) _
        Is Nothing Then
        
    Call FormatChart
    
    End If
    End Sub
    Now I need to do the same thing for a different cell range (E3:E52) and a different macro (FormatChart2). Do I need to make a new Private sub or can I add it into the existing code?
    Last edited by zanguard80; 02-03-2014 at 07:12 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] ? Variable Ranges ? how to change address in Formula range base on another cell value ?
    By DrAlloway in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-27-2014, 07:34 PM
  2. Change range of cells within VBA macro and copy and paste to fixed cell range
    By Mannyny in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-20-2012, 11:51 AM
  3. [SOLVED] macros to change fonts in range depending on cell value
    By vash1628 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-28-2012, 03:51 PM
  4. Insert row after date change
    By nana15nuna in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2012, 11:43 PM
  5. conditional cell shading when a change occurs
    By zooeyhall in forum Excel General
    Replies: 1
    Last Post: 06-06-2005, 01:05 PM

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