View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Looping through listbox controls

You are probabky looking at userform answers.

Try

Dim i As Long

For i = 1 To ActiveSheet.OLEObjects.Count
If TypeName(ActiveSheet.OLEObjects(i).Object) = "ListBox" Then
Msgbox ActiveSheet.OLEObjects(i).Name
End If
Next i


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Vince" wrote in message
...
I have a worksheet with 51 listbox controls on it, Listbox1 - Listbox51.

I
need to loop through them and get the Value in each one and store it away.

I
have looked through the questions posted here, and the answer appears easy
enough, however, I don't know if I have an Excel problem or something

else.
For some reason the Me.Controls line of code will not work. When I am

typing
the line of code, the drop down gives me several properties and methods to
use for the "Me." but not "Controls".
Can anyone provide some help with this!!

Thank you
Vince