Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 12, 11:18*am, pswanie
wrote: i all ready got this macro in... and it works.. and cant get the one from gtvt06 to work... please and thanx 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("sheet2").Range("d42").Value = myStr * * Unload UserForm1 * * Sheets("DATA SHEET").Select * * * * Range("A111").Select End Sub Private Sub UserForm_Initialize() * * Dim myRng As Range * * With Worksheets("sheet1") * * * * Set myRng = .Range("c1", .Cells(.Rows.Count, "c").End(xlUp)) * * End With * * With Me.ListBox1 * * * * .MultiSelect = fmMultiSelectMulti * * * * .ListStyle = fmListStyleOption * * * * .List = myRng.Value * * End With End Sub did you change the sheet, button, textbox names and etc. on my code to match your actual names? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Display Worksheet Range in a Textbox | Excel Discussion (Misc queries) | |||
TextBox value to hide a row in another worksheet | Excel Programming | |||
How to retrieve data from worksheet to a textbox | Excel Programming | |||
put worksheet values into textbox on form | Excel Programming | |||
I have had trouble with textbox text to worksheet | Excel Discussion (Misc queries) |