How do you create a drop down menu in VBA
example a menu with the following options
Black
Red
Green
How do you create a drop down menu in VBA
example a menu with the following options
Black
Red
Green
Goto menu Data>Validation, set Allow to List, and enter the values as comma
delimited list
--
HTH
Bob Phillips
(remove nothere from the email address if mailing direct)
"cedtech23" <[email protected]> wrote in
message news:[email protected]...
>
> How do you create a drop down menu in VBA
>
> example a menu with the following options
>
> Black
> Red
> Green
>
>
> --
> cedtech23
> ------------------------------------------------------------------------
> cedtech23's Profile:
http://www.excelforum.com/member.php...o&userid=31022
> View this thread: http://www.excelforum.com/showthread...hreadid=506963
>
thank you for the response... I really wanted to know how to do that in the VBA enviroment with a form. sorry I was not clear
With Userform.Listbox1
.AddItem "Black"
.AddItem "Red"
.AddItem "Green"
End With
or
With Userform.Combobox1
.AddItem "Black"
.AddItem "Red"
.AddItem "Green"
End With
--
HTH
Bob Phillips
(remove nothere from the email address if mailing direct)
"cedtech23" <[email protected]> wrote
in message news:[email protected]...
>
> thank you for the response... I really wanted to know how to do that in
> the VBA enviroment with a form. sorry I was not clear
>
>
> --
> cedtech23
> ------------------------------------------------------------------------
> cedtech23's Profile:
http://www.excelforum.com/member.php...o&userid=31022
> View this thread: http://www.excelforum.com/showthread...hreadid=506963
>
From the macro recorded:
Sub Macro12()
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="=$A$1:$A$3"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub
HTH
Regards,
Howard
"cedtech23" <[email protected]> wrote in
message news:[email protected]...
>
> How do you create a drop down menu in VBA
>
> example a menu with the following options
>
> Black
> Red
> Green
>
>
> --
> cedtech23
> ------------------------------------------------------------------------
> cedtech23's Profile:
> http://www.excelforum.com/member.php...o&userid=31022
> View this thread: http://www.excelforum.com/showthread...hreadid=506963
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks