Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
More information please ?
-- Regards Ron de Bruin http://www.rondebruin.nl "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! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try, instead,:
MSGBOX(myRange.Address) -- Gary's Student "davegb" wrote: 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! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "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! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I correct scroll bar range? | Excel Discussion (Misc queries) | |||
Assign number to correct range | Excel Discussion (Misc queries) | |||
Scatter chart not plotting correct range | Charts and Charting in Excel | |||
Selecting the correct number from a range of cells | Excel Worksheet Functions | |||
How do I correct a range 'reference'? | New Users to Excel |