View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
davegb davegb is offline
external usenet poster
 
Posts: 573
Default How to id if range is correct?


NickHK wrote:
Not sure how you determine the correct range, but

Debug.Assert MyRange.Address=Selection.Address

However, it is seldom necessary to .select objects in order to work with
them, so you may (probably) not need the .select anyway.

NickHK


Thanks for all your replies.

What I'm hearing is that VBA doesn't tell the user what range a range
variable represents. You have to do a select or a message box to find
out. That's not what I wanted to hear, but what I need to know!


"davegb" wrote in message
oups.com...
One of the things I have the most trouble with in VBA is figuring out
when I'm working with a range, if the range I want to be selected is
the correct one. Doing a watch doesn't help. Is the best way simply to
put in a temporary "range.select" and see if it's the correct one, or
is there a better way?

Thanks again!


Thanks for all your replies!

What I'm hearing is, the only way to know what range a range variable
is representing is a select or a msgbox, which amount to pretty much
the same thing. There's no built-in feature to id what a range is.