Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Testing selection against named range

I have a named range and when a user selects a cell I want to see if
their selection is inside that range. Any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Testing selection against named range

right click sheet tabview codeinsert this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("ifrng")) Is Nothing Then MsgBox "Yes"
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
ps.com...
I have a named range and when a user selects a cell I want to see if
their selection is inside that range. Any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Testing selection against named range

Nice. Figured there was something like that out there.


On Jul 16, 12:30 pm, "Don Guillett" wrote:
right click sheet tabview codeinsert this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("ifrng")) Is Nothing Then MsgBox "Yes"
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

ps.com...

I have a named range and when a user selects a cell I want to see if
their selection is inside that range. Any ideas?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default right click sheet tabview codeinsert thisPrivate Sub

I have a problem where i could 10k named ranges. When i select an area of the sheet, i need to know which of those named ranges is selected. I have it working by looping over Workbook.names collection, but that takes 14 seconds. Any other way to ask excel what named ranges are intersecting the selection?

On Monday, July 16, 2007 12:19 PM BartParr wrote:


I have a named range and when a user selects a cell I want to see if
their selection is inside that range. Any ideas?



On Monday, July 16, 2007 12:30 PM Don Guillett wrote:


right click sheet tabview codeinsert this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("ifrng")) Is Nothing Then MsgBox "Yes"
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
ps.com...



On Monday, July 16, 2007 2:08 PM BartParr wrote:


Nice. Figured there was something like that out there.



On Monday, July 16, 2007 3:05 PM Don Guillett wrote:


Glad to help

--
Don Guillett
Microsoft MVP Excel
SalesAid Software






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default right click sheet tabview codeinsert thisPrivate Sub

Firstly, have 10k names is a really, really bad idea.

Secondly, having them workbook level is a really, really bad idea.

IMO, a better worksheet design would be more efficient...

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Reply
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 A RANGE OF CELLS Richard[_2_] Excel Worksheet Functions 3 April 1st 07 02:52 PM
Testing a person's age to be within a range MH Excel Worksheet Functions 10 December 31st 06 11:04 PM
Selecting Multiple Columns in a Named Selection Griffithpt Excel Worksheet Functions 0 August 9th 06 10:54 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM


All times are GMT +1. The time now is 12:50 PM.

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"