Combobox Form Help

sebhughes

New Member
Joined
Sep 21, 2006
Messages
20
I have a a worksheet a1 and down is names b1 and down is numbers

eg

sebastianhughes 1143

I have a form and the combo box and displays the names and below I ahve a textbox and I want it to show there number how cna I do this?

So if i pick sebastianhughes form the box the textbox in the form will show 1143?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
How have you populated the combobox?

If you've used the RowSource property then you can probably use ListIndex to get the number.
Code:
Private Sub ComboBox1_Change()
    TextBox1.Value = Range("B" & ComboBox1.ListIndex + 1)
End Sub
 
Upvote 0
Wow man works a treat :D

How would I be able to have it so I cna add a uservia the form.

So I would ahve 2 fields.

Name

Number

ANd when i entered this it would then add the name to the next avaible cell in a and number would go in the next avaliable cell in b
 
Upvote 0
How can I have it so the combo box size. Is only as big as the number of people.

Say in a1

there were 2 names, Id want the combobox to only be 2 options big if you get me.

*edit* I think it the rowsource. So the row source will only ake the cells that have a value?
 
Upvote 0
Also I ahve this code:

Code:
Private Sub ComboBox1_Change()
TextBox4.Text = Worksheets("Friends").Range("B" & ComboBox1.ListIndex + 2)


End Sub



Private Sub CommandButton1_Click()

person = TextBox4.Text

Message = TextBox2.Text

send = "net send " & person & " " & Message & ""

Shell (send)

End Sub

and it doesnt seem to be sending the message why is this?
 
Upvote 0

Forum statistics

Threads
1,217,356
Messages
6,136,077
Members
449,988
Latest member
Mabbas

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