Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populating Sheet Data From A UserForm Combo Box Enabled For Multi-Choices


I have a userform with a combo box. I have the combo box enabled to
allow multiple selections. My delima is I want to populate a field or
possibly multiple fields on sheet1 with these selected items. To give a
better understanding the combo list is a list of names I want to
populate on Sheet1 to make a cc: list. This can either be in a single
cell or multiple, just I have had no luck with coding it.

Thanks in advance for any help you can provide!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Populating Sheet Data From A UserForm Combo Box Enabled For Multi-Choices

R

I assume you mean listbox and not combobox. This command button click event
sub will put all the selections in a single cell

Private Sub CommandButton1_Click()

Dim i As Long
Dim CCNames As String

For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) Then
CCNames = CCNames & Me.ListBox1.List(i) & Chr(10)
End If
Next i

CCNames = Left(CCNames, Len(CCNames) - 1)

Sheet1.Range("a1").WrapText = True
Sheet1.Range("a1").Value = CCNames

Unload Me

End Sub

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"R3df1sh" wrote in message
...

I have a userform with a combo box. I have the combo box enabled to
allow multiple selections. My delima is I want to populate a field or
possibly multiple fields on sheet1 with these selected items. To give a
better understanding the combo list is a list of names I want to
populate on Sheet1 to make a cc: list. This can either be in a single
cell or multiple, just I have had no luck with coding it.

Thanks in advance for any help you can provide!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements


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
Excel 2007-macro enabled, multi-sheet opening in minimized mode LT Excel Discussion (Misc queries) 0 March 11th 10 05:36 PM
UserForm and combo box to another sheet Nigel Excel Discussion (Misc queries) 0 April 29th 05 09:41 AM
Populating a lis/combo box in excel with access data Enrico Lisk Excel Programming 1 October 3rd 03 01:12 PM
Populating a VBA UserForm Danny Sowden Excel Programming 0 August 19th 03 03:11 PM
Populating Textbox in UserForm Derek[_2_] Excel Programming 3 July 10th 03 10:41 PM


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