Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Detecting Table Change

All,
I am using Excel 2007. I have a range on a sheet that I have defined as a
Table using the "Format As Table" button on the Styles tab of the ribbon.

Using Code, I would like to detect when someone has inserted a new row into
the table, so that I can go off and do some other things.

Can anyone tell me how to detect that insertion?

Thanks,
Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Detecting Table Change


I didn't just run off and test this, but I would think Worksheet_Change
would cover it. If any formulas reference a table column,
Worksheet_Calculate will also do the trick.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Steve Haack" wrote in message
...
All,
I am using Excel 2007. I have a range on a sheet that I have defined as a
Table using the "Format As Table" button on the Styles tab of the ribbon.

Using Code, I would like to detect when someone has inserted a new row
into
the table, so that I can go off and do some other things.

Can anyone tell me how to detect that insertion?

Thanks,
Steve



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Detecting Table Change

But, Wouldn't that tell me when ANYTHING on the sheet changes? only want to
know when the table has changed. How would I filter down to that?

Steve

"Jon Peltier" wrote:

I didn't just run off and test this, but I would think Worksheet_Change
would cover it. If any formulas reference a table column,
Worksheet_Calculate will also do the trick.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Steve Haack" wrote in message
...
All,
I am using Excel 2007. I have a range on a sheet that I have defined as a
Table using the "Format As Table" button on the Styles tab of the ribbon.

Using Code, I would like to detect when someone has inserted a new row
into
the table, so that I can go off and do some other things.

Can anyone tell me how to detect that insertion?

Thanks,
Steve




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Detecting Table Change

You check for which cells changed. The range that triggers the event is
called Target. A table is called a listobject. This is the basic code you
would use:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.ListObjects(1).DataBodyRange) Is Nothing Then
MsgBox "changed the table"
End If
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______

"Steve Haack" wrote in message
...
But, Wouldn't that tell me when ANYTHING on the sheet changes? only want
to
know when the table has changed. How would I filter down to that?

Steve

"Jon Peltier" wrote:

I didn't just run off and test this, but I would think Worksheet_Change
would cover it. If any formulas reference a table column,
Worksheet_Calculate will also do the trick.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Steve Haack" wrote in message
...
All,
I am using Excel 2007. I have a range on a sheet that I have defined as
a
Table using the "Format As Table" button on the Styles tab of the
ribbon.

Using Code, I would like to detect when someone has inserted a new row
into
the table, so that I can go off and do some other things.

Can anyone tell me how to detect that insertion?

Thanks,
Steve






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting the change of a certain cell Fan Zhang Excel Programming 0 July 25th 08 07:45 AM
Detecting a change in a cell Brad Stone[_2_] Excel Programming 4 March 14th 08 10:25 PM
Detecting Change in State of Internet Explorer Ash Excel Programming 9 October 9th 06 02:28 AM
Cell value - detecting change tgmjf Excel Worksheet Functions 2 July 20th 06 08:12 PM
Detecting Worksheet change Tim[_14_] Excel Programming 2 July 10th 03 01:47 PM


All times are GMT +1. The time now is 02:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"