View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Zych Tim Zych is offline
external usenet poster
 
Posts: 389
Default Define Range Dynamically

Does this help?

Sheet1.Range(Sheet1.Range("Groups")(1, 1), _
Sheet1.Range("Groups")(1, 1).End(xlDown)).Name = "Groups"
frmManageGroups.cboGroups.RowSource = "Groups"



"Randy" wrote in message
oups.com...
I know this one should be easy, but I can't make it work. I'm trying
to dynamically define a range and assign it to a combobox on a user
form as the rowsource. Here is my code:

dim rngGrpList as Range
Set rngGrpList = Sheet1.Range("Groups",
Sheet1.Range("Groups").Offset.End(xlDown))
frmManageGroups.cboGroups.RowSource = rngGrpList

I'm getting a type mismatch error. It seems that my second line is
capturing the contents of the cells rather than their addresses. I've
played around with different ideas, but nothing seems to work. Can
anybody see why this won't work as intended?

Thanks,
Randy