who can help me ...thanks

tokhimi

Board Regular
Joined
Jul 10, 2010
Messages
61
Private Sub UserForm_Initialize()
Dim ComboBox1 As Range
Dim ws As Worksheet
Set ws = Worksheets("sheet1")


For Each ComboBox1 In ws.Range("Model")
With Me.ComboBox1
.AddItem ComboBox1.Value
.List(ListCount - 1, 2) = ComboBox1.Offset(0, 1).Value


End With
Next ComboBox1

For Each Label1 In ws.Range("part")
With Me.Label1
.AddItem Label1.Caption
End With
Next Label1

Me.ComboBox1.SetFocus
End Sub



when choose combobox1 value at sheets1 column A row 2

label 1 will follow get data with that same row 2 and capture column b text in sheets 1

then label 2 will follow get data at the same row 2 and capture column c text in sheets1
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
To fill your comboboxes try:

Code:
Dim Sh As Worksheet
Dim Rng1 As Range
Private Sub UserForm_Initialize()
    Set Sh = Worksheets("Sheet1")
    With Sh
        Set Rng1 = .Range("A2:A" & .Range("A2").End(xlDown).Row)
        ComboBox1.List = Rng1.Value
    End With
End Sub
 
Private Sub ComboBox1_Change()
    Dim Rng2 As Range
    Dim Rng3 As Range
    With Sh
        Set Rng2 = .Cells.Find(What:=ComboBox1.Value, After:=Rng1.Cells(ComboBox1.ListIndex + 1), LookIn:=xlValues, LookAt:=xlWhole)
        Set Rng2 = .Range(Rng2.Offset(1), Rng2.Offset(1).End(xlDown))
        ComboBox2.List = Rng2.Value
        Set Rng3 = .Cells.Find(What:=ComboBox1.Value, After:=Rng1.Cells(ComboBox1.ListIndex + 1), LookIn:=xlValues, LookAt:=xlWhole)
        Set Rng3 = .Range(Rng3.Offset(1, 1), Rng3.Offset(1, 1).End(xlDown))
        ComboBox3.List = Rng3.Value
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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