xicoandrade
New Member
- Joined
- Feb 20, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
- MacOS
Dear all, help!
I need VBA do read every vale from a cell that contains a data validation list the is defined by a given range.
I notice in the past WarPigl3t posted the following code for a similar question (btw, very neat!!).
Sub loopthroughvalidationlist()
validationListValues = Range("A3").Validation.Formula1
myDelimiter = ", "
mySplit = Split(validationListValues, myDelimiter)
For Each element In mySplit
MsgBox element
Next element
End Sub
Unfortunately this code works only when the datavalidation dropdown list is fixed (i.e. contains fixed values instead of linked to a range of cells).
In my case the list of items on the datavalidation dropdown list is defined by a range, such as the image below.
Can anyone help?
I need VBA do read every vale from a cell that contains a data validation list the is defined by a given range.
I notice in the past WarPigl3t posted the following code for a similar question (btw, very neat!!).
Sub loopthroughvalidationlist()
validationListValues = Range("A3").Validation.Formula1
myDelimiter = ", "
mySplit = Split(validationListValues, myDelimiter)
For Each element In mySplit
MsgBox element
Next element
End Sub
Unfortunately this code works only when the datavalidation dropdown list is fixed (i.e. contains fixed values instead of linked to a range of cells).
In my case the list of items on the datavalidation dropdown list is defined by a range, such as the image below.
Can anyone help?