View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
vlado_varna vlado_varna is offline
external usenet poster
 
Posts: 5
Default Can I determine in which cell is a listbox postioned?Or how to get the listboxes in a certain cell?

Hello,

I tried to find ,whether this was discussed before,but couldn't find
anything.I will be thankful for any ideas.
I have a task related to transformation of Excel to XML.
And I encounter this specific problem:
I have coulpe of listboxes (created from the Forms toolbar,bot ActiveX
controls).

My problem is to find out ,in which cell is positioned each listbox.
The list boxes are not linked to cells.But rather I need the cell
,where they are positioned.

In general it will be also a solution for me if I can get the listboxes
positioned in a given cell ..let's say for example in cell A1.

I try with :
Range("A1").Activate
MsgBox "Selected index " & _
Selection.ShapeRange(1).ControlFormat.ListIndex

But it seems this is not the correct way.

What I notice is that a List Box is assigne more or less to the
cell,where the left corner of the listbox is.At least the listbox moves
by default with this cell.

Is it possible for example to select a range within the sheet and then
to get all shapes,positioned in the range.That would solve my problem.

Thanks in advance ..
Any ideas are welcomed

Best regards

Vlado