ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform Combo box to mimick Worksheet Cell validation list range. (https://www.excelbanter.com/excel-programming/418431-userform-combo-box-mimick-worksheet-cell-validation-list-range.html)

LaDdIe

Userform Combo box to mimick Worksheet Cell validation list range.
 
Hi Everyone,

Is there a method which tells a Userform Combo box to mimick active
Worksheet Cell validation list range.

My worksheet contains data validation lists in various places,
I have designed a userform combo box, in order to 'quick search', but rather
than hard code the list range, I need the userform combo box to mirror the
data validation list range of the active cell.

Thanks.

LaDdIe

joel

Userform Combo box to mimick Worksheet Cell validation list range.
 
Add the code to the initial function of the userform.

ListRange = Range("A1").Validation.Formula1
'remove equal sign
ListRange = Mid(ListRange, 2)
UserForm1.ListBox1.RowSource = ListRange



"LaDdIe" wrote:

Hi Everyone,

Is there a method which tells a Userform Combo box to mimick active
Worksheet Cell validation list range.

My worksheet contains data validation lists in various places,
I have designed a userform combo box, in order to 'quick search', but rather
than hard code the list range, I need the userform combo box to mirror the
data validation list range of the active cell.

Thanks.

LaDdIe


LaDdIe

Userform Combo box to mimick Worksheet Cell validation list ra
 
Thanks for your prompt reply, its just the solution I was looking for.

"Joel" wrote:

Add the code to the initial function of the userform.

ListRange = Range("A1").Validation.Formula1
'remove equal sign
ListRange = Mid(ListRange, 2)
UserForm1.ListBox1.RowSource = ListRange



"LaDdIe" wrote:

Hi Everyone,

Is there a method which tells a Userform Combo box to mimick active
Worksheet Cell validation list range.

My worksheet contains data validation lists in various places,
I have designed a userform combo box, in order to 'quick search', but rather
than hard code the list range, I need the userform combo box to mirror the
data validation list range of the active cell.

Thanks.

LaDdIe



All times are GMT +1. The time now is 04:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com