View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_968_] Simon Lloyd[_968_] is offline
external usenet poster
 
Posts: 1
Default Worksheet_change event


eggpap, why not attach a workbook here so we can actually see what the
problem is.eggpap;177156 Wrote:
Sorry I mistaken the post writing, consider the snippet correctly
performing.
It runs correctly on an empty wb.
This problem is similar to that posted on
'This Post' (http://tinyurl.com/7ao6ur)
I tried to place the Application.enablevents before and after the code
but nothing happens. The enableevents=true is never executed and after
the first run the change event is no more triggered, I have to close and
to reopen the wb to continue to test. With or without enableevents the
code is not completely executed: some udf intercepts it.

Thanks
============
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 7 Then
Target.Offset(1) = "x"
End If
End Sub
============

Also, you should watch for instances when the cell in row 7 was cleared
of data and clear the matching row 8 as well, just a suggestion:
============
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Row = 7 Then
If Target = "" Then
Target.Offset(1) = ""
Else
Target.Offset(1) = "x"
End If
End If
End Sub
============



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=48998