Thread: Combo Headache
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Combo Headache

That presumably means that your worksheet is not named B, you need to change
that.

You could also change the VBE options (ToolsOptions) to break on all errors
(on the General tab, Errors frame) so you see the real error.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
Hi
when adding this code into "Private Sub UserForm_Initialize()" the button

Private Sub cmdNewEntry_Click()
UserForm1.Show
End Sub
returns with an error code "Run-time error 9" "Subscript out of range"
is the code for the button in the wrong place?

"Bob Phillips" wrote:

Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = Worksheets("B").Range("A1:A100")
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Zaahir" wrote in message
...
hey
I have a 2 workbooks A & B. A cntains a userform with a combobox. The
combobox needs to display data on B colA.
please guide me in doing this!!!!
Regards