Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
entering time via combobox Atishoo Excel Discussion (Misc queries) 0 February 10th 09 01:40 PM
2 questions! Related to combobox and time function. HELP!! Bruno Excel Discussion (Misc queries) 11 September 28th 07 02:33 PM
help on spinbutton controllinng a text or ComboBox showing time [email protected] Excel Discussion (Misc queries) 4 July 29th 07 04:11 AM
Combobox creates error Stephen Excel Worksheet Functions 0 January 23rd 05 10:55 AM
Run time combobox control in excel Anu Excel Programming 0 January 20th 04 01:11 AM


All times are GMT +1. The time now is 03:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"