Thread: Code error
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Code error

I don't get that error as long as the named range exists. You're sure that
named range exists and is spelled correctly?



"M&M" wrote:

Does anyone know whats wrong with the code below?
I get an error in the third line where it starts with: Set inputrange=.....

Says Application defined or Object defined error



Private Sub SelectArguments_Click()
EngIndex = EngineSelect.List(EngineSelect.ListIndex, -1)
Set inputrange = Sheets("Output").Range("Eng_Range")
Set Inrng = Range(inputrange(1, EngIndex + 1),
inputrange(inputrange.Rows.Count, EngIndex + 1))
For Each Cell In Inrng
If IsEmpty(Cell.Value) Then
Exit For
Else
UserForm1.ListBox2.AddItem (Cell.Value)
End If
Next
UserForm1.Show
End Sub