ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting checkboxes (https://www.excelbanter.com/excel-programming/274105-counting-checkboxes.html)

Shamsul

Counting checkboxes
 
How do you count the number of Checkboxes in a Userform?

Tom Ogilvy

Counting checkboxes
 
Dim ctrl as Control
Dim icnt as long
icnt = 0
for each ctrl in Userform1.Controls
if typeof ctrl is MSForms.CheckBox then
icnt = icnt + 1
end if
Next
msgbox "there are " & icnt & " checkboxes"

--
Regards,
Tom Ogilvy


"Shamsul" wrote in message
...
How do you count the number of Checkboxes in a Userform?





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

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