View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Brettjg Brettjg is offline
external usenet poster
 
Posts: 295
Default SelectionChange problem

That's it! It works now. Tricky little suckers eh? Thank you very much for
all your efforts. Regards, Brett.

"CmK" wrote:

Hi again

You dont really have to re reference the range name to include all the
merged cells
Justr use Range("MyRangeName").Mergearea.address

Anyways I have done some testing
Heres the codes i used
and it worked fine
I hope this helped
My range name was Cell and A1 to C2

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyTestString As Variant
Dim oMergearea As Object
Set oMergearea = Range("Cell").MergeArea

MyTestString = oMergearea.Cells(1, 1).Value

If Target.Address = oMergearea.Address And MyTestString = "AAAA" Then
MsgBox "True"
Else
MsgBox "false"
End If


End Sub