Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Selection change code with merged cells


"Ryan H" wrote in message
...
Yes, I got the same issue. Excel automatically closes when the code is
executed when using .Value2(1,1), WEIRD, must be a bug. Is Sheet1 the
sheet
you have this code in? I did this and didn't have any issues.

I also shorten your code by not using a variable, but if you need to use
the
rTick variable, then I would suggest you declare you variables. For
example
rTick needs to be declared as a Range. I would recommend putting Option
Explicit at the top of each of your modules to ensure you don't have any
undeclared variables which can make your code very difficult to debug.

Hope this helps! If so, let me know, click "YES" below.

Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----- ENABLE TICKS IN RELEVANT BOXES -----

If Not Intersect(Target, Range("R11:S12")) 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 Sub

--
Cheers,
Ryan


Thanks Ryan. That works, though I do need the variable in there as the range
varies depending on the content of a specific cell.

Bernie's version of the code is perfect. I just need to incorporate it into
my original workbook, but that won't be until tomorrow.

--
Ian
--


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
Probklem with code, when merged cells Jan Kronsell Excel Programming 2 November 21st 08 10:24 AM
Autofit Merged cell Code is changing the format of my merged cells JB Excel Discussion (Misc queries) 0 August 20th 07 02:12 PM
Problem with code for merged cells SuitedAces[_25_] Excel Programming 5 July 7th 06 09:40 PM
changing merged cells from code john Excel Programming 7 July 6th 05 10:24 PM
Fine-tuning selection change event for merged cells & wrap text Lucy Barber Excel Programming 0 September 7th 04 10:10 PM


All times are GMT +1. The time now is 03:48 PM.

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"