Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform - ComboBox fills TextBox not working thom hoyle Excel Programming 1 June 21st 05 08:25 PM
UserForm TextBox/ComboBox question grasping@straws Excel Discussion (Misc queries) 1 February 2nd 05 11:14 AM
combobox/textbox/userform/other question RPIJG[_49_] Excel Programming 1 June 16th 04 07:53 PM
Question about ComboBox/Userform/TextBox etc. RPIJG[_41_] Excel Programming 8 June 16th 04 03:41 PM
Userform ComboBox and TextBox help!!! Pete Excel Programming 1 February 13th 04 09:13 PM


All times are GMT +1. The time now is 11:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"