ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programmatically Extracting Validation List (https://www.excelbanter.com/excel-programming/402727-programmatically-extracting-validation-list.html)

Barb Reinhardt

Programmatically Extracting Validation List
 
I have a selection that has a validation list attached to it and I'd like to
extract the list that's tied to it programmatically. How would I go about
doing that?

Thanks,
Barb Reinhardt

sebastienm

Programmatically Extracting Validation List
 
Say you want the data validation list associated with the active cell

dim address as string
dim rg as range
address=activecell.Validation.formula1
set rg=application.range(address)

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Barb Reinhardt" wrote:

I have a selection that has a validation list attached to it and I'd like to
extract the list that's tied to it programmatically. How would I go about
doing that?

Thanks,
Barb Reinhardt


sebastienm

Programmatically Extracting Validation List
 
ACtually Formula1 returns '=' in front of the range address. So instead, use:
address = strings.replace(activecell.Validation.formula1,"=" ,"")
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"sebastienm" wrote:

Say you want the data validation list associated with the active cell

dim address as string
dim rg as range
address=activecell.Validation.formula1
set rg=application.range(address)

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Barb Reinhardt" wrote:

I have a selection that has a validation list attached to it and I'd like to
extract the list that's tied to it programmatically. How would I go about
doing that?

Thanks,
Barb Reinhardt



All times are GMT +1. The time now is 08:05 AM.

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