Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help w/Insert


How can I recognize, in VBA, when a cell and/or a line is inserted i
Excel?

Thank yo

--
Bir
-----------------------------------------------------------------------
Bird's Profile: http://www.excelforum.com/member.php...fo&userid=2446
View this thread: http://www.excelforum.com/showthread.php?threadid=38069

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Help w/Insert

I think there's no special event for this purpose. But you can detect
with simulating a special "row counter"
if you can, in any column of your last row (after the last used row)
insert a cell with the formula "=ROW(A12)"
(if the cell is in the cell A12, this mean the line 12 is after the
last used one) Give a special name to that cell (example: "last_row")

Since each time you insert a line, the value of this special cell will
change, then a calculate event will occure !
Wone !

in the sheet events:

Dim old_last_row As Double

Private Sub Worksheet_Calculate()
with Me.Range("last_row")
If .Value < old_last_row Then
'nb of rows changed
old_last_row = .Value
End If
end with
End Sub

there are for sure many ways to do this, but you need to detect this
event from another one, since there's no special event launched when you
insert a line.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help w/Insert


abcd,

I’ve implemented your solutions and it works fine.

Thanks,

Bird


--
Bird
------------------------------------------------------------------------
Bird's Profile: http://www.excelforum.com/member.php...o&userid=24469
View this thread: http://www.excelforum.com/showthread...hreadid=380699

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
Cannot insert worksheet in exel - not available in insert menu pedro39 Excel Worksheet Functions 1 July 24th 08 12:09 PM
insert row / insert column command buttons fairgreen Excel Worksheet Functions 1 October 29th 07 02:41 PM
Can I auto insert a worksheet when I insert a value in a cell. iainc Excel Worksheet Functions 0 April 27th 06 08:37 AM
Insert Next? Or insert a variable number of records...how? Tom MacKay Excel Discussion (Misc queries) 0 April 20th 06 10:44 PM
Insert cell/format/text/fontsize and auto insert into header? Unfurltheflag Excel Programming 2 November 3rd 04 05:39 PM


All times are GMT +1. The time now is 07:39 AM.

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

About Us

"It's about Microsoft Excel"