Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Probklem with code, when merged cells | Excel Programming | |||
Autofit Merged cell Code is changing the format of my merged cells | Excel Discussion (Misc queries) | |||
Problem with code for merged cells | Excel Programming | |||
changing merged cells from code | Excel Programming | |||
Fine-tuning selection change event for merged cells & wrap text | Excel Programming |