combobox help

gta18

New Member
Joined
Apr 13, 2006
Messages
11
I have this code below and the comboboxes gets its data from a worksheet i have, my question is there are like 5 columns/fields on my worksheet, I want the other 4comboboxes to get the data out of the same row where i click. Like if i click on one value on one combobox that came from row 4, then i want combobox3, 4 and 5 to get the value of the column right next to where the data came from.


a b c d
e f g h
i j k l
m n o p

the above example shows the items available that came from the worksheet. what i would like to happen is when i click on "e" that is at row2col1, i want combbx2 and 3 to highlight and have the value of "f" and "g" respectively. I can't figure it out how to do it. please help me....
thanks you very much/....



Sub load_form()
'GoTo start

Application.ScreenUpdating = True
Application.ScreenUpdating = True
Dim lastrow As Integer
Dim lastcraft As Integer
Dim lastwrkordr As Integer
Dim lastPO As Integer

Dim lastEW As Integer
Dim lastemp As Integer


Excel.Workbooks.Open Filename:= _
"C:\Documents and Settings\nog\My Documents\EIU timekeeping\EIU database\EMPLOYEE_LIST.xls"



' ActiveWorkbook.Save
'ActiveWindow.Close

EIUProjectsFrm.strght.Value = 10
EIUProjectsFrm.timehalf.Value = 0
Sheets("EIU_emp_list").Activate
With Sheets("EIU_emp_list")
lastemp = Range("b65335").End(xlUp).Row

'EIUProjectsFrm.EIU_EmpName.RowSource = "a2:A" & lastrow
EIUProjectsFrm.EIU_EmpName.RowSource = "b2:b" & lastemp
EIUProjectsFrm.EIU_employee_list.RowSource = "b2:B" & lastemp
'EIUProjectsFrm.EIU_employee_list_man = EIUProjectsFrm.e


'FrmData.TextBox1.Text =
'Sheets("WKEND").Activate
'Sheets("WE 03-19-06").Activate
End With

Sheets("hours").Activate
With Sheets("hours")
laststhour = Range("A65335").End(xlUp).Row
lastothour = Range("b65335").End(xlUp).Row
lastdthour = Range("c65335").End(xlUp).Row

'EIUProjectsFrm.strght.RowSource = "a2:a" & laststhour
'EIUProjectsFrm.timehalf.RowSource = "b2:b" & lastothour
' EIUProjectsFrm.dbltime.RowSource = "c2:c" & lastdthour
End With




Sheets("EIU_projects").Activate

With Sheets("EIU_emp_list")
lastwrkordr = Range("C65335").End(xlUp).Row
lastPO = Range("D65335").End(xlUp).Row
lastEW = Range("B65335").End(xlUp).Row
'lastEW = lastPO1.Offset(0, 1) 'Range("B65335").End(xlUp).Row


EIUProjectsFrm.EIU_project_Wnmbr.RowSource = "c2:c" & lastwrkordr 'work order column
EIUProjectsFrm.EIU_project_POnmbr.RowSource = "d2:d" & lastPO 'PO column
EIUProjectsFrm.EIU_project.RowSource = "B2:B" & lastEW




End With

Sheets("EIU_craft").Activate
With Sheets("EIU_craft")
lastcraft = Range("B65335").End(xlUp).Row
EIUProjectsFrm.EIU_CRAFT.RowSource = "b2:b" & lastemp

End With
EIUProjectsFrm.Show
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

JerryGiese

Active Member
Joined
Jun 27, 2005
Messages
323

ADVERTISEMENT

Do you want to be able to select the cell while the userform is up or select the cell and then show the userform?
 

gta18

New Member
Joined
Apr 13, 2006
Messages
11
select an item from one of the combobox in the userform then display the other fields pertaining to the same row on the one i selected and display it on the other comboboxes.
 

gta18

New Member
Joined
Apr 13, 2006
Messages
11
Don't worry guys I found the solution! :) what a relief.... I used the listindex property.
thanks
 

Forum statistics

Threads
1,141,718
Messages
5,708,068
Members
421,543
Latest member
SGM

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