ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Setting the Validation Criteria on the fly (https://www.excelbanter.com/excel-discussion-misc-queries/165511-setting-validation-criteria-fly.html)

PDABACC

Setting the Validation Criteria on the fly
 
Help!!
I have a WorkBook with a Sheet that contains lists that are defined as named
ranges. I am using VB within Excel to build a sheet and want to set a cells
validation criteria from the lists.
For Example my Sheet called LISTS has a named range AI810 that has a list of
values 0..20mA, 1..5V, 4..20mA
When I insert a sheet using VB I want to set say cell A2 to the above
validation criteria. I know if I do it by hand you use the
=indirect("LISTS!AI810") and select a List. How do u do it from within VB

Bernie Deitrick

Setting the Validation Criteria on the fly
 
Use your macro recorder to get the code for setting the Validation to a
list - it is easy to modify from there.

But note that you cannot have a list named AI810, which is a valid cell
reference - but it may work if that cell has a name of a valid named range
in it.

So, I'm a little unclear on what you are actually doing.

Bernie

"PDABACC" wrote in message
...
Help!!
I have a WorkBook with a Sheet that contains lists that are defined as
named
ranges. I am using VB within Excel to build a sheet and want to set a
cells
validation criteria from the lists.
For Example my Sheet called LISTS has a named range AI810 that has a list
of
values 0..20mA, 1..5V, 4..20mA
When I insert a sheet using VB I want to set say cell A2 to the above
validation criteria. I know if I do it by hand you use the
=indirect("LISTS!AI810") and select a List. How do u do it from within VB





All times are GMT +1. The time now is 11:45 AM.

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