View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steven Cheng[_3_] Steven Cheng[_3_] is offline
external usenet poster
 
Posts: 2
Default For each...loop for checkboxes

I have a userform that has several (30) checkboxes and
want to test which ones have been selected by showing the
checkbox names through a messagebox.

I started my code off like this once the commandbutton on
the userform has been selected:

private sub commandbutton1_click()

dim r as checkbox
dim w as string

w = ""

for each r in userform1
if r.value then
w = w & r.caption & vbcr
end if
next

end sub

But it appears that I am not getting the right
object/collection combination.