+ Reply to Thread
Results 1 to 5 of 5

Callback for a cell changing with less code

  1. #1

    Callback for a cell changing with less code

    Hi,

    Is there a way to have a callback that fires when a cell changes value
    but w/o a Worksheet_Change for each worksheet. Sort of a global
    callback.

    I haven't done VBA programming in a couple years (can fight the
    withdrawl no longer) and I seem to recall that there's a way to create
    an object or something like that for this purpose. For example, in my
    old code I'm seeing this "app_SheetSelectionChange" code. No longer
    sure how it works, but something like that...

    Thanks!

    Aaron Fude


  2. #2
    NickHK
    Guest

    Re: Callback for a cell changing with less code

    Aaron,
    There is the Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
    As Range).
    So you get the sheet and range.

    If you to further, there's also Application_SheetSelectionChange(ByVal Sh As
    Object, ByVal Target As Range).
    http://www.cpearson.com/excel/AppEvent.htm

    NickHK

    <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > Is there a way to have a callback that fires when a cell changes value
    > but w/o a Worksheet_Change for each worksheet. Sort of a global
    > callback.
    >
    > I haven't done VBA programming in a couple years (can fight the
    > withdrawl no longer) and I seem to recall that there's a way to create
    > an object or something like that for this purpose. For example, in my
    > old code I'm seeing this "app_SheetSelectionChange" code. No longer
    > sure how it works, but something like that...
    >
    > Thanks!
    >
    > Aaron Fude
    >




  3. #3
    Bob Phillips
    Guest

    Re: Callback for a cell changing with less code

    You mean

    Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range).


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "NickHK" <[email protected]> wrote in message
    news:%[email protected]...
    > Aaron,
    > There is the Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal

    Target
    > As Range).
    > So you get the sheet and range.
    >
    > If you to further, there's also Application_SheetSelectionChange(ByVal Sh

    As
    > Object, ByVal Target As Range).
    > http://www.cpearson.com/excel/AppEvent.htm
    >
    > NickHK
    >
    > <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi,
    > >
    > > Is there a way to have a callback that fires when a cell changes value
    > > but w/o a Worksheet_Change for each worksheet. Sort of a global
    > > callback.
    > >
    > > I haven't done VBA programming in a couple years (can fight the
    > > withdrawl no longer) and I seem to recall that there's a way to create
    > > an object or something like that for this purpose. For example, in my
    > > old code I'm seeing this "app_SheetSelectionChange" code. No longer
    > > sure how it works, but something like that...
    > >
    > > Thanks!
    > >
    > > Aaron Fude
    > >

    >
    >




  4. #4
    NickHK
    Guest

    Re: Callback for a cell changing with less code

    Bob,
    Well, yes, if the OP is looking for an event when any cell value changes.
    But I paid more attention to his "SheetSelectionChange" comment.

    Depends which he has in mind.

    NickHK

    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > You mean
    >
    > Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range).
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "NickHK" <[email protected]> wrote in message
    > news:%[email protected]...
    > > Aaron,
    > > There is the Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal

    > Target
    > > As Range).
    > > So you get the sheet and range.
    > >
    > > If you to further, there's also Application_SheetSelectionChange(ByVal

    Sh
    > As
    > > Object, ByVal Target As Range).
    > > http://www.cpearson.com/excel/AppEvent.htm
    > >
    > > NickHK
    > >
    > > <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi,
    > > >
    > > > Is there a way to have a callback that fires when a cell changes value
    > > > but w/o a Worksheet_Change for each worksheet. Sort of a global
    > > > callback.
    > > >
    > > > I haven't done VBA programming in a couple years (can fight the
    > > > withdrawl no longer) and I seem to recall that there's a way to create
    > > > an object or something like that for this purpose. For example, in my
    > > > old code I'm seeing this "app_SheetSelectionChange" code. No longer
    > > > sure how it works, but something like that...
    > > >
    > > > Thanks!
    > > >
    > > > Aaron Fude
    > > >

    > >
    > >

    >
    >




  5. #5
    Bob Phillips
    Guest

    Re: Callback for a cell changing with less code

    Hi Nick,

    He did say

    .... when a cell changes value but w/o a Worksheet_Change for each worksheet.
    Sort of a global callback....

    but he did get confused didn't he? <G>


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "NickHK" <[email protected]> wrote in message
    news:[email protected]...
    > Bob,
    > Well, yes, if the OP is looking for an event when any cell value changes.
    > But I paid more attention to his "SheetSelectionChange" comment.
    >
    > Depends which he has in mind.
    >
    > NickHK
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:[email protected]...
    > > You mean
    > >
    > > Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range).
    > >
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (remove nothere from email address if mailing direct)
    > >
    > > "NickHK" <[email protected]> wrote in message
    > > news:%[email protected]...
    > > > Aaron,
    > > > There is the Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal

    > > Target
    > > > As Range).
    > > > So you get the sheet and range.
    > > >
    > > > If you to further, there's also Application_SheetSelectionChange(ByVal

    > Sh
    > > As
    > > > Object, ByVal Target As Range).
    > > > http://www.cpearson.com/excel/AppEvent.htm
    > > >
    > > > NickHK
    > > >
    > > > <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > Hi,
    > > > >
    > > > > Is there a way to have a callback that fires when a cell changes

    value
    > > > > but w/o a Worksheet_Change for each worksheet. Sort of a global
    > > > > callback.
    > > > >
    > > > > I haven't done VBA programming in a couple years (can fight the
    > > > > withdrawl no longer) and I seem to recall that there's a way to

    create
    > > > > an object or something like that for this purpose. For example, in

    my
    > > > > old code I'm seeing this "app_SheetSelectionChange" code. No longer
    > > > > sure how it works, but something like that...
    > > > >
    > > > > Thanks!
    > > > >
    > > > > Aaron Fude
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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