get the value for list box into code
Hi,
New to vba
I have been given help to devise a list box of options and I want to get the selected value for the list box into the following code:-
Select Case result
Case Listbox value???
'
' Send email as is
'
Item.Subject = Item.Subject
Cancel = False
Case Listbox value???
'
' Send message restricted
'
Item.Subject = "restricted"+Item.Subject
Cancel = False
Case Listbox value???
'
' Send message restricted staff
'
Item.Subject = "restricted staff"
Cancel = False
Case Listbox value???:
'
' do not send the email
'
Cancel = True
End Select
End If
End Sub
I would appreciate any help in this area
Cheers
get list box option into code
Quote:
Originally Posted by JP2112
Please use [ VBA ] tags when posting VBA code.
ListBox.Value will return the currently selected item, as long as MultiSelect is set to fmMultiSelectSingle.
Thanks for the above but can you advise me as to what code I need on the button click to inniate the correct select option
Thanking you in adavnce