Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
user form and radio buttons
is there, and what would it look like, a code i can put "behind" my userform
to 1) go check colum a down sheet1 how many names 2)for each name create a radio button 3)for each radio button thats activated go and put those names in cell d24 sheet2 in other words i need it to show all the 10 or 12 names(adding to it regularly) from column a down on sheet1 and then put the 3 or 4 names that the user select in cell d24 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
user form and radio buttons
I used column A (A1:A###) of sheet1 to get the name.
I didn't use a radio button. Radio buttons are usually used to limit the user to a single choice. You could use checkboxes so you could choose each name independently. But I used a Listbox with a style that looks like it has checkboxes next to it. My userform had a single listbox and a commandbutton: Option Explicit Private Sub CommandButton1_Click() Dim myStr As String Dim iCtr As Long Dim mySep As String mySep = ", " myStr = "" With Me.ListBox1 For iCtr = 0 To .ListCount - 1 If .Selected(iCtr) = True Then myStr = myStr & ", " & .List(iCtr) End If Next iCtr End With If myStr = "" Then 'nothing checked Else myStr = Mid(myStr, Len(mySep) + 1) End If Worksheets("sheet1").Range("d24").Value = myStr End Sub Private Sub UserForm_Initialize() Dim myRng As Range With Worksheets("sheet1") Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp)) End With With Me.ListBox1 .MultiSelect = fmMultiSelectMulti .ListStyle = fmListStyleOption .List = myRng.Value End With End Sub pswanie wrote: is there, and what would it look like, a code i can put "behind" my userform to 1) go check colum a down sheet1 how many names 2)for each name create a radio button 3)for each radio button thats activated go and put those names in cell d24 sheet2 in other words i need it to show all the 10 or 12 names(adding to it regularly) from column a down on sheet1 and then put the 3 or 4 names that the user select in cell d24 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
User form Command Buttons | Excel Discussion (Misc queries) | |||
How can I reset an Excel form that has radio buttons. | Excel Programming | |||
User Form Option & Command Buttons | Excel Programming | |||
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True | Excel Worksheet Functions | |||
2 sets of option buttons on one user form? | Excel Programming |