ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   filling a form with an array (https://www.excelbanter.com/excel-programming/343881-filling-form-array.html)

JT

filling a form with an array
 
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

Tom Ogilvy

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





All times are GMT +1. The time now is 08:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com