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: 157
Default Problem with Worksheet_SelectionChange

I have a problem with the following code. I've cut it down to remove a bunch
of conditions defining rTick, but the problem I have is with the actual code
to change the cells.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----- ENABLE TICKS IN RELEVANT BOXES -----
Application.EnableEvents = False
On Error GoTo sub_exit
With Worksheets("Sheet1")
Set rTick =
Worksheets("Sheet1").Range("AE9:AE10,Q11:S13,Q22:Q 25,S30:W40,AA17:AE38")
'--------Problem with this bit!!
If Not Intersect(Target, rTick) Is Nothing Then
With Target.Cells(1, 1)
If .Value = Chr(252) Then
.Value = ""
Else
.Value = Chr(252)
.Font.Name = "Wingdings"
End If
End With
End If
'--------
End With
sub_exit:
Application.EnableEvents = True
End Sub

Another part of my code copies named ranges from another sheet into Sheet1.
If the destination of the named range includes one or more of the cells in
rTick, the top left cell of the destination is overwritten with a tick.

For example, a named range is copied into Y6. It extends down and right to
AE11. As AE9 & AE10 are within the copied range, Y6 shows a tick.

If I substitute the following code, the problem goes away.

If Not Intersect(Target, rTick) Is Nothing Then
With Target
If .Value = Chr(252) Then
.Value = ""
Else
.Value = Chr(252)
.Font.Name = "Wingdings"
End If
End With
End If

The problem I have with this code is that some of the places I want ticks to
be produced are merged cells. Any idea how I can overcome this problem?

--
Ian
--


 
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
Worksheet_SelectionChange Gary''s Student Excel Programming 3 April 5th 06 09:46 AM
Worksheet_SelectionChange Problem Casey Excel Discussion (Misc queries) 2 September 20th 05 08:23 PM
problem with Worksheet_SelectionChange Valeria Excel Programming 7 January 25th 05 03:55 PM
Worksheet_SelectionChange Rasmus[_2_] Excel Programming 2 June 27th 04 07:19 PM
Worksheet_SelectionChange Bill Oertell[_2_] Excel Programming 8 April 23rd 04 05:18 AM


All times are GMT +1. The time now is 02:13 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"