Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Administration Form with Radio Controls

Hi

If I have an administration form in Excel that I want to send to colleagues
with radio buttons to select choices, how can I run a control process to
ensure that for the various items, the user has selected a choice for each
area i.e. that no area has simply been missed?

If possible, a simple robust process would be preferable.

Many thanks

Tim


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Administration Form with Radio Controls


This is not easy. I assume each set of radio buttons are in a Group
box. You can't find out which radio buttons are in each group box but
you can find which Group box a button is located. This is a 3 step
process.

1) Get the names of each group box and set the status of the Group box
to False indicating no radio buttons where found to be set.
2) Find all the radio buttons and get the Group box name and the Value
(checked or not checked). then if check change the status of the group
to True
3) then check all the Group boxes t find out if they are true or
false.


Sub TestGroups()
Dim Groups()
GroupCount = 0

'create an array of all the group boxes on the sheet
'first item is group name
For Each shp In ActiveSheet.Shapes

If shp.FormControlType = xlGroupBox Then
ReDim Preserve Groups(0 To GroupCount, 0 To 1)
Groups(GrouCount, 0) = shp.OLEFormat.Object.Name
'set value to false indicating not initialized
Groups(GrouCount, 0) = shp.OLEFormat.Object.Name
Groups(GrouCount, 1) = False
GroupCount = GroupCount + 1
End If
Next shp

'now get all the control buttons
For Each shp In ActiveSheet.Shapes

If shp.FormControlType = xlOptionButton Then
GroupName = shp.OLEFormat.Object.GroupBox.Name

If shp.OLEFormat.Object.Value = 1 Then
'find group name and set to true
For i = 0 To UBound(Groups, 1)
If Groups(i, 0) = GroupName Then
Groups(i, 1) = True
Exit For
End If
Next i
End If
End If
Next shp

'display the groups not initialized
For i = 0 To UBound(Groups, 1)
If Groups(i, 1) = False Then
MsgBox (Groups(i, 0) & " Has no value set")
End If
Next i


End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=145165

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Administration Form with Radio Controls

Hi Joel

Many thanks for posting this which I will be trying out on the sheet.

Best wishes

Tim

"joel" wrote in message
...

This is not easy. I assume each set of radio buttons are in a Group
box. You can't find out which radio buttons are in each group box but
you can find which Group box a button is located. This is a 3 step
process.

1) Get the names of each group box and set the status of the Group box
to False indicating no radio buttons where found to be set.
2) Find all the radio buttons and get the Group box name and the Value
(checked or not checked). then if check change the status of the group
to True
3) then check all the Group boxes t find out if they are true or
false.


Sub TestGroups()
Dim Groups()
GroupCount = 0

'create an array of all the group boxes on the sheet
'first item is group name
For Each shp In ActiveSheet.Shapes

If shp.FormControlType = xlGroupBox Then
ReDim Preserve Groups(0 To GroupCount, 0 To 1)
Groups(GrouCount, 0) = shp.OLEFormat.Object.Name
'set value to false indicating not initialized
Groups(GrouCount, 0) = shp.OLEFormat.Object.Name
Groups(GrouCount, 1) = False
GroupCount = GroupCount + 1
End If
Next shp

'now get all the control buttons
For Each shp In ActiveSheet.Shapes

If shp.FormControlType = xlOptionButton Then
GroupName = shp.OLEFormat.Object.GroupBox.Name

If shp.OLEFormat.Object.Value = 1 Then
'find group name and set to true
For i = 0 To UBound(Groups, 1)
If Groups(i, 0) = GroupName Then
Groups(i, 1) = True
Exit For
End If
Next i
End If
End If
Next shp

'display the groups not initialized
For i = 0 To UBound(Groups, 1)
If Groups(i, 1) = False Then
MsgBox (Groups(i, 0) & " Has no value set")
End If
Next i


End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=145165



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
grouping Radio Buttons; Using ActiveX Controls ryguy7272 Excel Discussion (Misc queries) 2 May 6th 10 06:01 PM
Radio button use in form John Galt[_2_] Excel Discussion (Misc queries) 2 February 19th 09 07:35 PM
user form and radio buttons pswanie Excel Programming 1 January 8th 08 09:02 PM
Simple radio button form help Scot B Excel Programming 2 March 1st 07 10:14 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM


All times are GMT +1. The time now is 04:48 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"