A
Amy
I want to create multiple list boxes in a user form, and then have the
selections appear in corresponding bookmarks.
I found this bit of code, but I don't understand why selections for both
Activity1 and Activity2 appear in the Activity2 bookmark. How can I make sure
that only Activity2 selections appear in Activity2 bookmark? Thanks!
For i = 1 To Activity1.ListCount
If Activity1.Selected(i - 1) Then
myString = myString + Activity1.List(i - 1) & vbCrLf
End If
Next
ActiveDocument.Bookmarks("Activity1").Range.InsertBefore myString
For i = 1 To Activity2.ListCount
If Activity2.Selected(i - 1) Then
myString = myString + Activity2.List(i - 1) & vbCrLf
End If
Next
ActiveDocument.Bookmarks("Activity2").Range.InsertBefore myString
selections appear in corresponding bookmarks.
I found this bit of code, but I don't understand why selections for both
Activity1 and Activity2 appear in the Activity2 bookmark. How can I make sure
that only Activity2 selections appear in Activity2 bookmark? Thanks!
For i = 1 To Activity1.ListCount
If Activity1.Selected(i - 1) Then
myString = myString + Activity1.List(i - 1) & vbCrLf
End If
Next
ActiveDocument.Bookmarks("Activity1").Range.InsertBefore myString
For i = 1 To Activity2.ListCount
If Activity2.Selected(i - 1) Then
myString = myString + Activity2.List(i - 1) & vbCrLf
End If
Next
ActiveDocument.Bookmarks("Activity2").Range.InsertBefore myString