combobox to cell

Hjemmet

Board Regular
Joined
Jun 20, 2018
Messages
207
I have on a Userform 20 Combobox to chose 20 Differens players from cell H62 to H82

My first Combobox 1 works fine

but they cant get the Rest to work….

and how did i get the combobox to put the player in cell

eksampel

Use combobox 1 to set player 1 in cell "B1" on Sheet"Lodtrækning"
and Combobox 2 to set player 2 in cell "B2" on Sheet"Lodtrækning"
Hope that that was enough info
 
Error message " Could not find the specified Object"


i this Line
Range("B" & i).Value = Me.Controls("combobox" & i).Value
 
Last edited:
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I never click on links or download files.
Your request seems very simple.

Are your Combobox's named Combobox1 and Combobox2 and on and on ?

These are the default names.

If not what are the Combobox names.
 
Upvote 0
The code from post#6 works for me, but you will need to change your initialise event to
Code:
Private Sub UserForm_Initialize()
    Set xRg = Worksheets("Lodtrækning").Range("H62:H85")
       For i = 1 To 20
     Me.Controls("combobox" & i).List = xRg.Value
   Next i
    
End Sub
and remove the Private Sub ComboBox1_Change() code
 
Upvote 0
after checking several times ive got a little error on the sheets where i run this macro

i have try to get my sheets Protected and when it runs it Aint protect sheets "Lodtrækning"
---------------------------------------------------
Private Sub CommandButton1_Click()


UserForm1.Hide
'after clicking o Button 1 Hide userform it should Protect sheet It aint Happend.
Sheets("Lodtrækning").Protect Password:="Dart"
End Sub


--------------------------------------------------------
Private Sub CommandButton2_Click()
Sheets("Lodtrækning").Protect Password:="Dart"
'On this Botton it set the name that part works Fine ad Sheets Unprotect ok
Dim i As Long
For i = 1 To 20

Range("B" & i).Value = Me.Controls("combobox" & i).Value

Next i

End Sub
--------------------------------------------------------

Private Sub UserForm_Initialize()
Set xRg = Worksheets("Lodtrækning").Range("H62:H85")
For i = 1 To 20
Me.Controls("combobox" & i).List = xRg.Value
Next i

End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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