![]() |
#1
|
|||
|
|||
![]()
Hello,
I have created a word template with User Form. In the latter; I have one field (actually a ListBox) where people can choose several entries. The coding of this box is: ListBoxMarking.List = Array("", "NATO", "The United Nations", "the African Union", "Troop Contributing States") The idea is that people can choose any entry, be it one, two or more. These entries would then appear in the created Word document. If no option was chosen, nothing should appear. If any option is chosen, it ought to be preceded by the phrase "Releasable to ". The coding for that is: Private Function Marking() As String Dim x As Integer Marking = "" For x = 0 To Me.ListBoxMarking.ListCount - 1 If Me.ListBoxMarking.Selected(x) Then If Marking = "" Then Marking = Me.ListBoxMarking.List(x) Else: Marking = "Releasable to " & Marking & ", " & Me.ListBoxMarking.List(x) End If End If Next x End Function The trouble is that the phrase "Releasable to " only appears when there is multiple choices and stays out when only on option is chosen. Could you please advise to fix this? Thanks, Paskie_be |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Kaatje | Word VBA | 2 | 02-27-2016 09:37 AM |
Link listbox (with multiple columns) to bookmark based on selection | dsjk9190 | Word VBA | 5 | 01-29-2015 11:28 PM |
This is a Userform LIstbox queston: A variable does not set to the value of a listbox | CatMan | Excel Programming | 14 | 08-18-2014 08:14 PM |
![]() |
CatMan | Excel | 1 | 08-08-2014 09:41 AM |
![]() |
dudeabides | Office | 1 | 07-04-2011 02:49 AM |