View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
curlydave curlydave is offline
external usenet poster
 
Posts: 206
Default time stamp capturing

On Feb 7, 10:45*am, Chip Pearson wrote:
You should disable events in the code:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("A1:B10")) Is Nothing Then
* * * * Target =Time
End If
Application.EnableEvents = True
End Sub

Otherwise, the code will change a cell, which triggers _Change, which
changes a cell, which triggers _Change, which changes a cell, which
triggers _Change and on and on until VBA terminates the loop when it
runs out of stack space.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
* * Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLCwww.cpearson.com


That makes total sense, interestingly that annoying loop does not
happen on my worksheet