LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Worksheet events...Why doesn't this work?!?! So confused!!

So I have written 2 worksheet events, 1 of which works, the other one
does not. But they're both the same!

In a nut shell this is what I'm trying to do. When a cell in range
B32:D45 is selected, cell F32 returns the data in the target cell. This
part works

What does not work: When I click a cell in range A3:D4, I want cell F32
to be cleared. The two pieces of code are exactly the same, but the
latter one does not work. Can someone please explain to me why? Any
help would be so greatly appreciated!


Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Me.Range("B32:D45")) Is Nothing Then Exit Sub

On Error GoTo errHandler:
Application.EnableEvents = False
Me.Parent.Worksheets("Output").Range("F32").Value = Target.Value

errHandler:
Application.EnableEvents = True

End Sub

Private Sub Worksheet_ClearChange(ByVal Target1 As Range)

If Intersect(Target1, Me.Range("A3:D4")) Is Nothing Then Exit Sub

On Error GoTo errHandler:
Application.EnableEvents = False
Me.Parent.Worksheets("Output").Range("F32").Value = ""

errHandler:
Application.EnableEvents = True

End Sub

 
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
Can't get Application Events to work with .xla M. Authement Excel Programming 3 May 24th 07 04:06 PM
disable events does not work Mika Excel Programming 3 October 15th 05 02:09 PM
events doesnt work benitAAvi Excel Programming 2 May 18th 05 03:09 PM
confused by COLUMN worksheet function KG Excel Discussion (Misc queries) 3 May 15th 05 04:28 AM
Workbook-Events donīt work with ChartObjects geissma Excel Programming 0 September 16th 03 01:09 PM


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

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"