Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have checkboxes with names from checkbox1 to checkbox20
if I try sub whatever() for i=1 to 20 if checkbox(i).value=true then do sumething end if next i end sub I get error message that sub or function not defined. How to fix that? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sub whatever()
for i=1 to 20 if Activesheet.OleObjects("checkbox" & i).value=true then do sumething end if next i end sub would be an example for a checkbox from the control toolbox toolbar where the checkboxes have names like checkbox1 to checkbox20. You haven't said where it is from or where it is located. -- Regards, Tom Ogilvy "kaptenn" wrote in message ... I have checkboxes with names from checkbox1 to checkbox20 if I try sub whatever() for i=1 to 20 if checkbox(i).value=true then do sumething end if next i end sub I get error message that sub or function not defined. How to fix that? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
These checkboxes are located in userform
"Tom Ogilvy" wrote: sub whatever() for i=1 to 20 if Activesheet.OleObjects("checkbox" & i).value=true then do sumething end if next i end sub would be an example for a checkbox from the control toolbox toolbar where the checkboxes have names like checkbox1 to checkbox20. You haven't said where it is from or where it is located. -- Regards, Tom Ogilvy "kaptenn" wrote in message ... I have checkboxes with names from checkbox1 to checkbox20 if I try sub whatever() for i=1 to 20 if checkbox(i).value=true then do sumething end if next i end sub I get error message that sub or function not defined. How to fix that? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sub whatever()
for i=1 to 20 if Userform1.Controls("checkbox" & i).value=true then do sumething end if next i end sub -- Regards, Tom Ogilvy "kaptenn" wrote in message ... These checkboxes are located in userform "Tom Ogilvy" wrote: sub whatever() for i=1 to 20 if Activesheet.OleObjects("checkbox" & i).value=true then do sumething end if next i end sub would be an example for a checkbox from the control toolbox toolbar where the checkboxes have names like checkbox1 to checkbox20. You haven't said where it is from or where it is located. -- Regards, Tom Ogilvy "kaptenn" wrote in message ... I have checkboxes with names from checkbox1 to checkbox20 if I try sub whatever() for i=1 to 20 if checkbox(i).value=true then do sumething end if next i end sub I get error message that sub or function not defined. How to fix that? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks a lot. And my task continues :)
"Tom Ogilvy" wrote: sub whatever() for i=1 to 20 if Userform1.Controls("checkbox" & i).value=true then do sumething end if next i end sub -- Regards, Tom Ogilvy "kaptenn" wrote in message ... These checkboxes are located in userform "Tom Ogilvy" wrote: sub whatever() for i=1 to 20 if Activesheet.OleObjects("checkbox" & i).value=true then do sumething end if next i end sub would be an example for a checkbox from the control toolbox toolbar where the checkboxes have names like checkbox1 to checkbox20. You haven't said where it is from or where it is located. -- Regards, Tom Ogilvy "kaptenn" wrote in message ... I have checkboxes with names from checkbox1 to checkbox20 if I try sub whatever() for i=1 to 20 if checkbox(i).value=true then do sumething end if next i end sub I get error message that sub or function not defined. How to fix that? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
Object Variable Not Set Error on Selection object | Excel Worksheet Functions | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming | |||
Pivot Table - Object variable or with block variable not set? | Excel Programming |