View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default 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/