Textbox value = Combobox value

mosiki

Board Regular
Joined
Oct 29, 2008
Messages
175
Hi

I'm sure this will be simple for the majority proficient in VBA, however, as newbie to the VBA world I need a quick fix.

I have a textbox named "Team". I have a Combibox named "Combibox1".

Combibox1 list is taken from a range of cells from a worksheet.

Eg. Lets say combibox1 list is the alphabet a.....z.

If i select "c" for the value in combibox1 what code do i need so that the textbox "Team" will equal "c", and change to match the combibox1 value every time a different value is selected from the list. Is this even possible or would I be better using 2 combiboxes or some other control form combination?

Thanks

Mosiki
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Re: Textbox value = Combibox value

try this
Code:
Private Sub ComboBox1_Change()
TextTeam = ComboBox1.Value
End Sub
 
Upvote 0
Re: Textbox value = Combibox value

no joy.

I've also tried:

Team.Value = Combobox1.Value
Team.Text = Combobox1.Value

maybe there are entries on the properties paramaeters i need to adjust for the textbox?

Mosiki
 
Upvote 0
Re: Textbox value = Combibox value

does your combobox have a LinkedCell property?
is, so, set that property to the Team cell
then no code is required
 
Upvote 0
Re: Textbox value = Combibox value

No, maybe I should also have mentioned that these are on 2 different userforms.


The combobox is on the first userform "TeamSelect", i make a selection on the drop down menu and click ok.

The code for click ok is :

Unload TeamSelect
DataInput.Show

This then opens the userform "DataInput", where the textbox "Team" resides.

Thanks

Mosiki
 
Upvote 0
Re: Textbox value = Combibox value

Code:
Private Sub ComboBox1_Change()
UserForm1.TextTeam = UserForm2.ComboBox1.Value
End Sub
Private Sub CommandButton1_Click()
 Unload UserForm2
UserForm1.Show
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top