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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
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
 

sebhughes

New Member
Joined
Sep 21, 2006
Messages
20
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
 

sebhughes

New Member
Joined
Sep 21, 2006
Messages
20
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?
 

sebhughes

New Member
Joined
Sep 21, 2006
Messages
20
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?
 

Forum statistics

Threads
1,136,366
Messages
5,675,351
Members
419,563
Latest member
blairtab

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
Top