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
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