finding address range
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Finding the address of a range.

Finding the address of a range.

resolvedResolved · Low Priority · Version 2007

replyReply Mon 16 Jan 2012, 08:30Delegate Roger said...

Roger has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course

Finding the address of a range.

Sub FindAddress()
Dim abc As Variant
Dim R As Range
Set R = Range("TestRange")
abc = R.Address
End Sub

The VBA above puts the address of range ‘R’ into the variable abc. The Locals window lists R, but there are a vast number of characteristics associated with it. My original question was, where can I find the address of the range in Locals?- but now I realise that I have no idea how to navigate around all of R’s characteristics. Is there any logic to the way that they are aranged in Locals? Why are there so many ‘name’ variables? What is ‘item’? ...

Roger

For upcoming training course dates see: Pricing & availability

replyReply Fri 20 Jan 2012, 09:20Trainer Mark said...

RE: Finding the address of a range.

Hello Roger,

The items you are seeing are the properties associated with the object you set. At the first level are the properties available to the Range, when you expand to another level of an individual object, e.g. CurrentRegion, you then have a list of all the properties assosiated with that, and so on.
Impossible to explain all the items here, but there is a logical hirachy structure to the system, you may find an image mapping on the web.

The range is specified in the Name property of currentregion.

As for items, like others that repeat, these are not used unless requested. Similar to when you record a macro of a dialog box, even though you only use one thing in that dialog, the code will record all the options and properties available, even if unused.

I hope this helps your question, but can be daunting. If it has, please mark this question as resolved.

If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?

Have a great day.
Regards,

Mark
Microsoft Office Specialist Trainer

replyReply Fri 20 Jan 2012, 13:25Delegate Roger said...

RE: Finding the address of a range.

Thanks, Mark. this makes life a lot easier.

I could have died of old age before finding it in the third level down!

Roger

 

Please browse our web site to find out more about
excel vba training course london and other Microsoft training courses.

Excel tip:

Selecting your working range

In excel if you have an area you want to highlight, press Ctrl + * or Ctrl+Shift+8 (to get the *). This will select your working range.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard