Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am attempting to create multi-page userform for use with surveys. The general idea is that each tab will house one of the questions and (more importantly) its possible answers. Below is my current attempt for the first question. RList is an array containing a list of names by region and changes depending on values of the active row when the userform is activated. If there is a way to make the "1" in "OptionButton1" change with the value of X I think I would have it. (as written, ObjectButton1 is moved to the end with a caption equal to the last object in RList) Private Sub MultiPage1_Change() Select Case MultiPage1.Value Case 0 For X = 0 To RList.Count - 1 OptionButton1.Left = 12 OptionButton1.Top = 30 + X * 18 OptionButton1.Caption = RList(X + 1) Next X Case 1 ... ... Case Else Exit Sub End Select End Sub Ideally, I'd like to start with a blank page then create, name, and place new controls (later portions of the survey will include text boxes and check boxes) by looping through various arrays like this. Currently I just have the max possible number of controls and will hide the ones not needed. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I follow
With Me.Controls("OptionButton" & myNum) ..left = 12 ' etc End With Regards, Peter T "Magness" wrote in message ... I am attempting to create multi-page userform for use with surveys. The general idea is that each tab will house one of the questions and (more importantly) its possible answers. Below is my current attempt for the first question. RList is an array containing a list of names by region and changes depending on values of the active row when the userform is activated. If there is a way to make the "1" in "OptionButton1" change with the value of X I think I would have it. (as written, ObjectButton1 is moved to the end with a caption equal to the last object in RList) Private Sub MultiPage1_Change() Select Case MultiPage1.Value Case 0 For X = 0 To RList.Count - 1 OptionButton1.Left = 12 OptionButton1.Top = 30 + X * 18 OptionButton1.Caption = RList(X + 1) Next X Case 1 ... ... Case Else Exit Sub End Select End Sub Ideally, I'd like to start with a blank page then create, name, and place new controls (later portions of the survey will include text boxes and check boxes) by looping through various arrays like this. Currently I just have the max possible number of controls and will hide the ones not needed. Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks. This will do it. "Peter T" wrote: If I follow With Me.Controls("OptionButton" & myNum) ..left = 12 ' etc End With Regards, Peter T "Magness" wrote in message ... I am attempting to create multi-page userform for use with surveys. The general idea is that each tab will house one of the questions and (more importantly) its possible answers. Below is my current attempt for the first question. RList is an array containing a list of names by region and changes depending on values of the active row when the userform is activated. If there is a way to make the "1" in "OptionButton1" change with the value of X I think I would have it. (as written, ObjectButton1 is moved to the end with a caption equal to the last object in RList) Private Sub MultiPage1_Change() Select Case MultiPage1.Value Case 0 For X = 0 To RList.Count - 1 OptionButton1.Left = 12 OptionButton1.Top = 30 + X * 18 OptionButton1.Caption = RList(X + 1) Next X Case 1 ... ... Case Else Exit Sub End Select End Sub Ideally, I'd like to start with a blank page then create, name, and place new controls (later portions of the survey will include text boxes and check boxes) by looping through various arrays like this. Currently I just have the max possible number of controls and will hide the ones not needed. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding Sheet Controls | Excel Programming | |||
Adding controls to a form at runtime | Excel Programming | |||
Adding Controls in a toolbar? | Excel Programming | |||
Adding controls to userform | Excel Programming | |||
Help with adding controls | Excel Programming |