View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default For...Each loop problem

For Each obj In ActiveSheet.OLEObjects
If obj.progID = "Forms.ListBox.1" Then
'enter your code here
End If
Next obj


"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