wrksheet selection change

B

Brettjg

The following code works perfectly in cell that is not merged:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Range("CHECK.NOTES").Address And
Range("CHECK.NOTES").Value = "END NOTES CHECK" Then
Application.Run "PERSONAL.xls!END_NOTES_CHECK"
End If
End Sub

but if the cell is merged it goes to debug. I have been careful to make sure
that the cell name is defined as the full merge range (eg $G$5:$J$6).
What am I missing please? Regards, Brett
 
J

Joel

Can you specify the error message and the line that failed. The problem
could be in the macro "PERSONAL.xls!END_NOTES_CHECK"
 
B

Brettjg

Hi Joel, Error 13, Type Mismatch. The macro is dead simple:


Sub END_NOTES_CHECK()
With Range("CHECK.NOTES"): .Font.ColorIndex = 39: .Interior.ColorIndex =
39: .ClearContents: End With
ActiveWindow.View = xlPageBreakPreviewSheets("LAUNCHPAD").Select
Sheets("LAUNCHPAD").Shapes("GP final routine").ZOrder msoBringToFront
Sheets("LAUNCHPAD").Shapes("GP final msg").ZOrder msoBringToFront
ActiveWorkbook.Save
End Sub

Brett
 
B

Brettjg

In fact, it doesn't matter which cell I click, it goes to the same error. As
soon as I unmerge the cell, and change the name range it works perfectly
again. Brett.
 
B

Brettjg

Hi Joel, a little bit me more info: if I unmerge the cells and leave the name
range as $G$5:$G$6 it goes to the same error (and also on any cell that I
click). Not sure if that helps. Brett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top