Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Define Range Dynamically
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to define a range | Excel Programming | |||
how to define a range | Excel Programming | |||
how to define a range in VBA | Excel Programming | |||
Trying to define a range for a graph dynamically within a macro | Excel Programming | |||
Define a range based on another named range | Excel Worksheet Functions |