Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
You obviously don't need the msgbox line that's judt to demonstrate it's wotking Sub marine() Dim ws As Worksheet Dim obj As OLEObject Set ws = Sheets("Sheet1") For Each obj In ws.OLEObjects If TypeName(obj.Object) = "ListBox" Then MsgBox TypeName(obj.Object) 'do something End If Next obj End Sub Mike "synapse5150" wrote: I am trying to loop through all the listboxes I have in an Excel worksheet (NOT userform), and I'm having problems. If this was a userform, I would use a for each loop (like 'for each control in userform.controls') but I'm not sure how to translate this collection to a worksheet. Any ideas? -- synapse5150 ------------------------------------------------------------------------ synapse5150's Profile: http://www.thecodecage.com/forumz/member.php?userid=115 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=58770 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with For Each loop | Excel Programming | |||
Loop Within a Loop Problem | Excel Programming | |||
for next loop problem | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
For...Each Loop Problem | Excel Programming |