View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Karen53 Karen53 is offline
external usenet poster
 
Posts: 333
Default named range as rowsource

Hi,

Thanks to you both for your replies.

I have tried these:

With frmPoolTypes.lstPoolList
.RowSource =
Worksheets("Table").Range("PoolTypes").Address(ext ernal:=True)
and I tried
.RowSource = "PoolTypes"
and I tried
.RowSource = Sheets("Table").Range("PoolTypes")
End With

The form comes up but with no data. I get no error messages.

I have double checked the names of my form, listbox, sheet and range.

I can set the caption for the form ok, but I'm not getting the data range.

What else could I be missing?

Thanks



"Dave Peterson" wrote:

Try:
..RowSource = "PoolTypes"

Personally, I find this more self-documenting:
..RowSource = worksheets("sheet9999").Range("PoolTypes").address (external:=true)


Karen53 wrote:

Hi,

I have a listbox that I am trying to set the rowsource with VBA. If I set
the rowsource manually in the properties window to mynameedrange, my code
works great. I'm having trouble with the code setting it with VBA.

Here's what I have:

With frmPoolTypes.lstPoolList
.RowSource = Range("PoolTypes")
.BoundColumn = 1
.ColumnCount = 1
.ListStyle = fmListStyleOption
End With

What am I doing wrong?

Thanks,


--

Dave Peterson