Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to verify a cell is in a named range

I give up. I have been trying to figure this out but I can only get half of
it. I think I need "professional help"!

I have a range name "TimeCells". I need to write an IF statement to verify
that the activecell is within the bounds of the named range. Also I need to
verify that I am on the correct worksheet.

Any help would be greatly appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default How to verify a cell is in a named range

One way:


Dim bSameSheet As Boolean
Dim bInRange As Boolean

With Range("TimeCells")
bSameSheet = .Parent Is ActiveSheet
If bSameSheet Then bInRange = _
Not Intersect(.Cells, ActiveCell) Is Nothing
End With

In article ,
"Terry Lowe" wrote:

I give up. I have been trying to figure this out but I can only get half of
it. I think I need "professional help"!

I have a range name "TimeCells". I need to write an IF statement to verify
that the activecell is within the bounds of the named range. Also I need to
verify that I am on the correct worksheet.

Any help would be greatly appreciated.

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
Referencing a named range based upon Range name entry in cell Barb Reinhardt Excel Worksheet Functions 14 June 20th 07 07:19 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
named cell range Marilyn Excel Worksheet Functions 2 March 13th 06 07:42 PM
Getting a named range from a cell value Charles Woll Excel Worksheet Functions 2 February 25th 05 03:39 PM
Adding a named range to a cell John[_80_] Excel Programming 1 June 22nd 04 10:51 PM


All times are GMT +1. The time now is 05:32 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"