Hi again. This forum has been invaluable.
I'd like to know the piece of code for a userform that would enter the combobox value by default unless any data is present in a textbox (as a "specify other" choice not present in the combobox).
Thanks!!!!
Hi again. This forum has been invaluable.
I'd like to know the piece of code for a userform that would enter the combobox value by default unless any data is present in a textbox (as a "specify other" choice not present in the combobox).
Thanks!!!!
With userform1.Combobox1
.Style = fmStyleDropDownCombo
.MatchRequired = False
.Value = "Specify Other"
End With
--
Regards,
Tom Ogilvy
"smplogc" <[email protected]> wrote in
message news:[email protected]...
>
> Hi again. This forum has been invaluable.
>
> I'd like to know the piece of code for a userform that would enter the
> combobox value by default unless any data is present in a textbox (as a
> "specify other" choice not present in the combobox).
> Thanks!!!!
>
>
> --
> smplogc
> ------------------------------------------------------------------------
> smplogc's Profile:
http://www.excelforum.com/member.php...o&userid=33887
> View this thread: http://www.excelforum.com/showthread...hreadid=537875
>
Thanks Tom!
I think I didn't explain myself clearly though. I'm talking about a userform with a combobox, a textbox, and an "Enter" command button. I want the commandbutton to always enter the combobox value unless the textbox contains data that was inputted by the user.![]()
Private Sub Commandbutton1_click()
Dim sh as Worksheet
set sh = Worksheets("Sheet1")
With Userform1
if .Textbox1.Text = "" then
sh.Range("B9").Value = .Combobox1.Value
else
sh.Range("B9").Value = .Textbox1.Text
end if
End With
End Sub
--
Regards,
Tom Ogilvy
"smplogc" <[email protected]> wrote in
message news:[email protected]...
>
> Thanks Tom!
>
> I think I didn't explain myself clearly though. I'm talking about a
> userform with a combobox, a textbox, and an "Enter" command button. I
> want the command button to always enter the combobox value unless the
> textbox contains data that was inputted by the user.
>
>
> --
> smplogc
> ------------------------------------------------------------------------
> smplogc's Profile:
http://www.excelforum.com/member.php...o&userid=33887
> View this thread: http://www.excelforum.com/showthread...hreadid=537875
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks