Testing selection against named range

  • Thread starter Thread starter BartParry
  • Start date Start date
B

BartParry

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?
 
right click sheet tab>view code>insert this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("ifrng")) Is Nothing Then MsgBox "Yes"
End 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
 

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

Back
Top