Programmatically Extracting Validation List

B

Barb Reinhardt

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
 
S

sebastienm

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)
 
S

sebastienm

ACtually Formula1 returns '=' in front of the range address. So instead, use:
address = strings.replace(activecell.Validation.formula1,"=","")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top