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: 389
Default Testing Range from other Sheets

I have the following code in Sheet1 which is where the range Priority exists.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Range("Priority"), Target) Is Nothing Then
Call FunctionOne
Else
Call FunctionTwo
End If
End Sub

If I am in a different Sheet and run the same code testing the named range
"Priority" I get this error message:

Method 'Range' of object'_worksheet' failed.

Is there a way to make it so I can test the Range from any Sheet in the file
so this code will work regardless of the sheet I am running it in. Note: the
range name I am testing will definitely exist. It just may not exist in the
current active sheet.

Thank you for your help.

Steven
 
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
TESTING A RANGE OF CELLS Richard[_2_] New Users to Excel 3 April 1st 07 02:52 PM
Testing same cell across multiple sheets for a string and counting each instance? [email protected] Excel Worksheet Functions 5 March 8th 07 02:57 PM
Testing a person's age to be within a range MH Excel Worksheet Functions 10 December 31st 06 10:04 PM
testing whether the ActiveCell is in a given range Paul Ponzelli Excel Programming 2 August 10th 05 05:20 PM
Testing for existence of range David Excel Programming 4 November 19th 03 07:39 AM


All times are GMT +1. The time now is 06:18 AM.

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

About Us

"It's about Microsoft Excel"