View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default filling a form with an array

a lot would depend on the particulars.


for i = 1 to 10
if arr(i) < "" then
with userform1.controls("checkBox" & i")
.Enabled = True
.Label = arr(i)
end With
else
userform1.controls("checkBox" & i).Enabled = False
end if
Next

--
Regards,
Tom Ogilvy



"JT" wrote in message
...
I have a form that has 10 checkboxes and want to write the captions based

on
an array I have previously filled. The array will change, 1 time it will
have 5 items and the next time it might have 7 or 8 and I plan on

disabling
any checkbox that won't have a caption.

I'm having trouble getting started with the code. Any help would be
appreciated.

--
JT