Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform: Enter combobox value unless textbox contains data
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform: Enter combobox value unless textbox contains data
With userform1.Combobox1
.Style = fmStyleDropDownCombo .MatchRequired = False .Value = "Specify Other" End With -- Regards, Tom Ogilvy "smplogc" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform: Enter combobox value unless textbox contains data
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. :) -- smplogc ------------------------------------------------------------------------ smplogc's Profile: http://www.excelforum.com/member.php...o&userid=33887 View this thread: http://www.excelforum.com/showthread...hreadid=537875 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform: Enter combobox value unless textbox contains data
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform: Enter combobox value unless textbox contains data
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform: Enter combobox value unless textbox contains data
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" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform - ComboBox fills TextBox not working | Excel Programming | |||
UserForm TextBox/ComboBox question | Excel Discussion (Misc queries) | |||
combobox/textbox/userform/other question | Excel Programming | |||
Question about ComboBox/Userform/TextBox etc. | Excel Programming | |||
Userform ComboBox and TextBox help!!! | Excel Programming |