LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 295
Default SelectionChange problem

The following code works perfectly for a cell that is NOT merged:
If Target.Address = Range("CHECK.EX.PAYERS").Address And
Range("CHECK.EX.PAYERS").Value = "END EXISTING PAYERS CHECK" Then:
Application.Run "PERSONAL.xls!END_EXISTING_PAYERS_CHECK"

The following code also works perfectly for a cell range that IS MERGED:
If Target.Address = Range("CHECK.EX.PAYERS").Address Then: Application.Run
"PERSONAL.xls!END_EXISTING_PAYERS_CHECK"

What DOESN'T work for a MERGED cell range is:
If Target.Address = Range("CHECK.EX.PAYERS").Address And
Range("CHECK.EX.PAYERS").Value = "END EXISTING PAYERS CHECK" Then:
Application.Run "PERSONAL.xls!END_EXISTING_PAYERS_CHECK"

nor will any other statement like:
If Not Range("CHECK.EX.PAYERS").Value = "END EXISTING PAYERS CHECK" Then
Exit Sub
End If

I get an error 13 Type mismatch.
PLEASE NOTE: I have been careful to ensure that the named range of the
merged cells describes the whole range (not just the first cell).

Can someone please help. It's doing my head in (and it's already done in
from a cold!). Regards, Brett.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SelectionChange Alex McDermott Excel Programming 1 May 3rd 07 03:54 PM
Worksheet selectionChange problem Sammie Excel Programming 6 March 30th 07 04:12 PM
Button Visibility / Selectionchange Problem mastermind Excel Programming 3 January 11th 07 10:08 PM
selectionchange problem micher Excel Programming 2 January 27th 04 07:15 PM
SelectionChange problem Micher Excel Programming 0 January 23rd 04 10:26 PM


All times are GMT +1. The time now is 08:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"