+ Reply to Thread
Results 1 to 4 of 4

Worksheet Multiple Change Events

  1. #1
    Forum Contributor
    Join Date
    07-11-2009
    Location
    NYC,USA
    MS-Off Ver
    Excel 2007
    Posts
    135

    Worksheet Multiple Change Events

    Hi,
    I realize that it’s not possible to have on one sheet, multiple Worksheet Change Events, so
    I tried to come up with an alternative method of handling it, but quickly realized that it’s beyond my capabilities at this time.

    I would like to set up a worksheet change event on each of a number of identical sheets.
    Each Change Event will run exactly the same macro.
    The exception is the “DeptStr” string value that is relevant to the sheet calling the macro .

    Each sheet will be a different department.
    • If the Target in either range has data added, then data will be added to the cell offset one column to it’s right.
    • If the Target in either range has data cleared, then data will be cleared in the cell offset one column to it’s right.
    • There can only be one sheet active at a time.
    • Only one sheet has data entered at a time.
    • The two non-contiguous ranges are of equal length. Ex. (C3:C52) and (E3:E52) and are uniquely named in this case,
    but they are not a necessary requirement in order to solve this problem if there is a more practical method employed.
    =============================================================
    This code, for all intents and purposes, is pseudo-code.
    My hope is that someone may be able to create the actual code.

    In this instance, myRngs are the range names for each sheet.
    Would I have to Dim each range on each sheet and set it to “DeptName” and “Charges”?

    ===============================================
    EACH WORKSHEET MODULE
    ==============================================
    Please Login or Register  to view this content.
    ================================================================
    MODULE 1
    ================================================================
    Please Login or Register  to view this content.

    I’ve attached a workbook with the sheets set up and examples of how the data should look.
    Thanks for your time

    Mark

    Attached Files Attached Files
    Last edited by max57; 01-24-2010 at 02:03 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Worksheet Multiple Change Events

    max57
    couldn't you use the workbook event
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Worksheet Multiple Change Events

    There is also a Workbook_SheetChange() event. You use it when you want the same Worksheet_Change() things happening on all worksheets:

    Please Login or Register  to view this content.
    Put that in the ThisWorkbook module and it will operate on all sheets equally.
    Last edited by JBeaucaire; 01-24-2010 at 07:51 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Contributor
    Join Date
    07-11-2009
    Location
    NYC,USA
    MS-Off Ver
    Excel 2007
    Posts
    135

    Thumbs up Re: Worksheet Multiple Change Events

    Pike and JBeaucaire,

    It works like a charm.
    Thanks for teaching me something new.
    Less is definitely much better.

    Thanks
    Mark

+ 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