Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox run time error
Hello. Back again with another trouble. I keep getting a run tim
error 13 when I arrow down the list that combobox4 displays when th form is opened. Is there some code I can enter that once I arrow dow to an empty cell, combobox will go back to the top of the list i column D? Thanks in advance! Private Sub combobox4_Click() Dim dt As Long With crit If .ComboBox4.ListIndex = -1 Then Exit Sub dt = ComboBox4.Value For Each Cell In Worksheets("METRO").Range("D1:D200") If Cell.Text = dt Then TextBox1.Value = Cell.Offset(0, 3).Text TextBox2.Value = Cell.Offset(0, -2).Text TextBox3.Value = Cell.Offset(0, 30).Text TextBox4.Value = Cell.Offset(0, 23).Text TextBox5.Value = Cell.Offset(0, -1).Text TextBox6.Value = Cell.Offset(0, 1).Text TextBox7.Value = Cell.Offset(0, 2).Text TextBox8.Value = Cell.Offset(0, 4).Text TextBox9.Value = Cell.Offset(0, 6).Text TextBox10.Value = Cell.Offset(0, 7).Text TextBox11.Value = Cell.Offset(0, 8).Text TextBox12.Value = Cell.Offset(0, 16).Text TextBox13.Value = Cell.Offset(0, 9).Text TextBox14.Value = Cell.Offset(0, 31).Text TextBox15.Value = Cell.Offset(0, 32).Text TextBox16.Value = Cell.Offset(0, 26).Text TextBox17.Value = Cell.Offset(0, 27).Text TextBox18.Value = Cell.Offset(0, 5).Text End If Next End With End Su -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox run time error
Not sure I understand the problem. Have you tried using the Change event
rather than the Click event? -- Vasant "Oreg " wrote in message ... Hello. Back again with another trouble. I keep getting a run time error 13 when I arrow down the list that combobox4 displays when the form is opened. Is there some code I can enter that once I arrow down to an empty cell, combobox will go back to the top of the list in column D? Thanks in advance! Private Sub combobox4_Click() Dim dt As Long With crit If .ComboBox4.ListIndex = -1 Then Exit Sub dt = ComboBox4.Value For Each Cell In Worksheets("METRO").Range("D1:D200") If Cell.Text = dt Then TextBox1.Value = Cell.Offset(0, 3).Text TextBox2.Value = Cell.Offset(0, -2).Text TextBox3.Value = Cell.Offset(0, 30).Text TextBox4.Value = Cell.Offset(0, 23).Text TextBox5.Value = Cell.Offset(0, -1).Text TextBox6.Value = Cell.Offset(0, 1).Text TextBox7.Value = Cell.Offset(0, 2).Text TextBox8.Value = Cell.Offset(0, 4).Text TextBox9.Value = Cell.Offset(0, 6).Text TextBox10.Value = Cell.Offset(0, 7).Text TextBox11.Value = Cell.Offset(0, 8).Text TextBox12.Value = Cell.Offset(0, 16).Text TextBox13.Value = Cell.Offset(0, 9).Text TextBox14.Value = Cell.Offset(0, 31).Text TextBox15.Value = Cell.Offset(0, 32).Text TextBox16.Value = Cell.Offset(0, 26).Text TextBox17.Value = Cell.Offset(0, 27).Text TextBox18.Value = Cell.Offset(0, 5).Text End If Next End With End Sub --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
entering time via combobox | Excel Discussion (Misc queries) | |||
2 questions! Related to combobox and time function. HELP!! | Excel Discussion (Misc queries) | |||
help on spinbutton controllinng a text or ComboBox showing time | Excel Discussion (Misc queries) | |||
Combobox creates error | Excel Worksheet Functions | |||
Run time combobox control in excel | Excel Programming |