Code doesn't work on merged cells
Yes, but it didn't appear to work on that. Looking more closely, when I
first open the sheet, ComboBox1 (CB1) is disabled. When I enter data in M2
and tab onwards, CB1 becomes enabled. Thsi is correct. If I then delete the
contents of M2, CB1 should disable, but it doesn't.
This is with the original code with just M2 in the address and range.
Any ideas?
"Neil" wrote in message
...
Ian,
Doesn't the merged cell have the address of M2
Neil
"IC" wrote in message
...
This code used to work when it was pointed to a single cell. I can't get
it
to work now that M2:N2 are merged. Any ideas how I can get round this?
Unfortunately I need the cells merged :-(
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
' If Target.Count 1 Then Exit Sub
If Target.Address = "$M$2:$N$2" Then
If IsEmpty(Me.Range("M2:N2")) Then
Me.ComboBox1.Enabled = False
Else
Me.ComboBox1.Enabled = True
End If
End If
End Sub
Any suggestions will be gratefully received
Ian
|