Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default store chkbox.caption in array


store chkbox.caption of selected checkboxes only in array.

suppose..
chkbox1.caption is = FARES
chkbox2.caption is = RULES
chkbox3.caption is = ZONES
chkbox4.caption is = CONDITIONS
chkbox5.caption is = ROUTING

now below are chkbox selected from above..
chkbox1
chkbox3
chkbox4

get the name of selected chkboxes and store as...
MyArray = Array("FARES", "ZONES", "CONDITIONS"

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=37703

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default store chkbox.caption in array

Assume the checkboxes are from the control toolbox toolbar and are located
on a userform:

Dim myArray(), i as long, j as Long
Redim MyArray(1 to 5)
j = 0
for i = 1 to 5
if userform1.controls("chkbox" & i).Value = True then
j = j + 1
myarray(j) = userform1.Controls("chkbox" & i).caption
end if
Next
if j 0 then
Redim Preserve MyArray(1 to j)
else
erase myArray
End if

--
Regards,
Tom Ogilvy

"ilyaskazi" wrote
in message ...

store chkbox.caption of selected checkboxes only in array.

suppose..
chkbox1.caption is = FARES
chkbox2.caption is = RULES
chkbox3.caption is = ZONES
chkbox4.caption is = CONDITIONS
chkbox5.caption is = ROUTING

now below are chkbox selected from above..
chkbox1
chkbox3
chkbox4

get the name of selected chkboxes and store as...
MyArray = Array("FARES", "ZONES", "CONDITIONS")


--
ilyaskazi
------------------------------------------------------------------------
ilyaskazi's Profile:

http://www.excelforum.com/member.php...o&userid=23969
View this thread: http://www.excelforum.com/showthread...hreadid=377033



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default store chkbox.caption in array


working perfect...

but is it possible if our checkboxes names (not caption) are customize
as per our requirement

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=37703

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default store chkbox.caption in array

Dim myArray(), i as long, j as Long
Redim MyArray(1 to 5)
j = 0
for i = 1 to 5
if userform1.controls("chkbox" & i).Value = True then
j = j + 1
myarray(j) = "chkbox" & i
end if
Next
if j 0 then
Redim Preserve MyArray(1 to j)
else
erase myArray
End if

--
Regards,
Tom Ogilvy


"ilyaskazi" wrote
in message ...

working perfect...

but is it possible if our checkboxes names (not caption) are customized
as per our requirement.


--
ilyaskazi
------------------------------------------------------------------------
ilyaskazi's Profile:

http://www.excelforum.com/member.php...o&userid=23969
View this thread: http://www.excelforum.com/showthread...hreadid=377033



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Store array ??? piero Excel Worksheet Functions 4 September 16th 09 04:39 PM
Can one store a string in a Array element? [email protected] Excel Discussion (Misc queries) 1 April 17th 07 12:53 PM
Trying To Store Shapes/Objects to an array ?? Tom Ogilvy Excel Programming 2 September 21st 04 09:49 PM
Trying To Store Shapes/Objects to an array ?? Dan Thompson Excel Programming 0 September 21st 04 08:37 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"