Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Run Time Error 424 Combo Box User Form

Hey all my BRILLIANT friends,
Can you help? I am getting a run time error

Private Sub UserForm_Initialize()
Dim cVend As Range
Dim cRan As Range
Dim cProd As Range

For Each cVend In wksLookupLists.Range("VendorList")
With Me.cboVend
.AddItem cVend.Value
.List(.ListCount - 1, 1) = cVend.Offset(0, 1).Value
End With
Next cVend
For Each cRan In wksLookupLists.Range("RanchIDList")
With Me.cboRan
.AddItem cRan.Value
.List(.ListCount - 1, 1) = cRan.Offset(0, 1).Value
End With
Next cRan
For Each cProd In wksLookupLists.Range("ProduceIDList")
With Me.cboProd
.AddItem cProd.Value
.List(.ListCount - 1, 1) = cProd.Offset(0, 1).Value
End With
Next cProd

End Sub
--
Though daily learning, I LOVE EXCEL!
Jennifer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Run Time Error 424 Combo Box User Form

on what line does the error occur. Your code worked fine for me. Step through
your code and see where it breaks. In the immediate window
?err.description

I did this with a new workbook
1) chaged a sheetname to wksLookupLists
3) added three named ranges matching your names in the code
4) added a userform with three combos, same names as per your code
5) pasted your code into the code page of the userform

I ran first time, no issues. If your range names or wks name was wrong,
you'd get a 1004 error. if combobox names were wrong you'd geta compile error.



"Jennifer" wrote:

Hey all my BRILLIANT friends,
Can you help? I am getting a run time error

Private Sub UserForm_Initialize()
Dim cVend As Range
Dim cRan As Range
Dim cProd As Range

For Each cVend In wksLookupLists.Range("VendorList")
With Me.cboVend
.AddItem cVend.Value
.List(.ListCount - 1, 1) = cVend.Offset(0, 1).Value
End With
Next cVend
For Each cRan In wksLookupLists.Range("RanchIDList")
With Me.cboRan
.AddItem cRan.Value
.List(.ListCount - 1, 1) = cRan.Offset(0, 1).Value
End With
Next cRan
For Each cProd In wksLookupLists.Range("ProduceIDList")
With Me.cboProd
.AddItem cProd.Value
.List(.ListCount - 1, 1) = cProd.Offset(0, 1).Value
End With
Next cProd

End Sub
--
Though daily learning, I LOVE EXCEL!
Jennifer

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Run Time Error 424 Combo Box User Form

Hey Patrick,
It is not hightling the area that has a problem it just says
"Run Time Error 424"
Object required

I have to let you know this is a first time for me writing something like
this, so I'm pretty stuck. How can I tell were the error occurs. Have double
checked all names and worksheet names. I will double check again. Thank you
for your time. Jennifer

"Patrick Molloy" wrote:

on what line does the error occur. Your code worked fine for me. Step through
your code and see where it breaks. In the immediate window
?err.description

I did this with a new workbook
1) chaged a sheetname to wksLookupLists
3) added three named ranges matching your names in the code
4) added a userform with three combos, same names as per your code
5) pasted your code into the code page of the userform

I ran first time, no issues. If your range names or wks name was wrong,
you'd get a 1004 error. if combobox names were wrong you'd geta compile error.



"Jennifer" wrote:

Hey all my BRILLIANT friends,
Can you help? I am getting a run time error

Private Sub UserForm_Initialize()
Dim cVend As Range
Dim cRan As Range
Dim cProd As Range

For Each cVend In wksLookupLists.Range("VendorList")
With Me.cboVend
.AddItem cVend.Value
.List(.ListCount - 1, 1) = cVend.Offset(0, 1).Value
End With
Next cVend
For Each cRan In wksLookupLists.Range("RanchIDList")
With Me.cboRan
.AddItem cRan.Value
.List(.ListCount - 1, 1) = cRan.Offset(0, 1).Value
End With
Next cRan
For Each cProd In wksLookupLists.Range("ProduceIDList")
With Me.cboProd
.AddItem cProd.Value
.List(.ListCount - 1, 1) = cProd.Offset(0, 1).Value
End With
Next cProd

End Sub
--
Though daily learning, I LOVE EXCEL!
Jennifer

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Run Time Error 424 Combo Box User Form

go into the IDE and step through the code -- pressing F8 steps it.
You'll get an error on one line ... we need to identify it.

"Jennifer" wrote in message
...
Hey Patrick,
It is not hightling the area that has a problem it just says
"Run Time Error 424"
Object required

I have to let you know this is a first time for me writing something like
this, so I'm pretty stuck. How can I tell were the error occurs. Have
double
checked all names and worksheet names. I will double check again. Thank
you
for your time. Jennifer

"Patrick Molloy" wrote:

on what line does the error occur. Your code worked fine for me. Step
through
your code and see where it breaks. In the immediate window
?err.description

I did this with a new workbook
1) chaged a sheetname to wksLookupLists
3) added three named ranges matching your names in the code
4) added a userform with three combos, same names as per your code
5) pasted your code into the code page of the userform

I ran first time, no issues. If your range names or wks name was wrong,
you'd get a 1004 error. if combobox names were wrong you'd geta compile
error.



"Jennifer" wrote:

Hey all my BRILLIANT friends,
Can you help? I am getting a run time error

Private Sub UserForm_Initialize()
Dim cVend As Range
Dim cRan As Range
Dim cProd As Range

For Each cVend In wksLookupLists.Range("VendorList")
With Me.cboVend
.AddItem cVend.Value
.List(.ListCount - 1, 1) = cVend.Offset(0, 1).Value
End With
Next cVend
For Each cRan In wksLookupLists.Range("RanchIDList")
With Me.cboRan
.AddItem cRan.Value
.List(.ListCount - 1, 1) = cRan.Offset(0, 1).Value
End With
Next cRan
For Each cProd In wksLookupLists.Range("ProduceIDList")
With Me.cboProd
.AddItem cProd.Value
.List(.ListCount - 1, 1) = cProd.Offset(0, 1).Value
End With
Next cProd

End Sub
--
Though daily learning, I LOVE EXCEL!
Jennifer



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
Adding items to a combo box on a user form Gazz_85[_2_] Excel Discussion (Misc queries) 1 July 9th 09 05:00 PM
Closing Excel user form generates error Ken Warthen Excel Discussion (Misc queries) 0 October 10th 07 08:30 PM
User Form Error theguz Excel Discussion (Misc queries) 3 August 15th 05 10:49 PM
Measuring Time in a user form syntax Martha[_2_] Excel Programming 4 May 20th 04 08:05 AM


All times are GMT +1. The time now is 05:21 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"