Does this help?
Sheet1.Range(Sheet1.Range("Groups")(1, 1), _
Sheet1.Range("Groups")(1, 1).End(xlDown)).Name = "Groups"
frmManageGroups.cboGroups.RowSource = "Groups"
"Randy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>
|