M
mlv
I'm trying to use some event code kindly provided by Bob Phillips in message
(13/07/2007) that alternately
puts and removes a tick in each cell of a range of cells.
I've used this code before and it has worked fine, but this time I have
problems.
Initially when I clicked on a cell, nothing seemed to happen. Then I
realised that each cell was in fact two merged cells, i.e. cell C6 is
actually cells C6 & C7 merged, through to cell C46 actually being C46 & C47
merged.
I changed the code line 'If .Count = 1 Then' to 'If .Count = 2 Then'
on the assumption that 'Count' would still see two cells, even though they
were merged.
Now I keep getting a 'Run-time error 13': Type mismatch. Debug highlights
the line: 'If .Value = "" Then'
Any suggestions?
Thanks
(13/07/2007) that alternately
puts and removes a tick in each cell of a range of cells.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "C6:C46"
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Count = 1 Then
If .Value = "" Then
.Value = "a"
.Font.Name = "Marlett"
Else
.Value = ""
End If
.Offset(0, 1).Select
End If
End With
End If
End Sub
I've used this code before and it has worked fine, but this time I have
problems.
Initially when I clicked on a cell, nothing seemed to happen. Then I
realised that each cell was in fact two merged cells, i.e. cell C6 is
actually cells C6 & C7 merged, through to cell C46 actually being C46 & C47
merged.
I changed the code line 'If .Count = 1 Then' to 'If .Count = 2 Then'
on the assumption that 'Count' would still see two cells, even though they
were merged.
Now I keep getting a 'Run-time error 13': Type mismatch. Debug highlights
the line: 'If .Value = "" Then'
Any suggestions?
Thanks