Application.Selection and its items

  • Thread starter Thread starter ojv
  • Start date Start date
O

ojv

Application.Selection can contain several items. Is is possible to loop
through these ? If so how?

Any help appreciated.
 
Dim mpArea As Range

For Each mpArea In Selection.Areas

Debug.Print mpArea.Address
Next mpArea


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Yes. But what if Selection consists of multiple shapes or chartobjects only?
 
Dim myShape as shape
dim myChtObj as ChartObject

For Each myShape in Selection.Shapes

next myShape

for Each myChtObj in Selection.ChartObjects

Next myChtObj
 
Why didn't you say that in the first place?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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