D
Dave O
I have inherited a workbook of questionable design- many named ranges,
for instance, that are used by dropdowns for data validation. I'd like
to go cell by cell and determine if data validation is used in that
cell, and if yes what named range is referenced.
I could make this work if the following code would run, but it
generates an error. This is the kind of cell-by-cell test I'd like to
perform. Can anyone suggest better syntax? Thanks!
Sub test()
Dim rCell As Range
For Each rCell In ActiveSheet.UsedRange
If rCell.Validation.InCellDropdown = True Then 'THIS LINE GENERATES
THE ERROR
MsgBox rCell.Address
End If
Next rCell
End Sub
for instance, that are used by dropdowns for data validation. I'd like
to go cell by cell and determine if data validation is used in that
cell, and if yes what named range is referenced.
I could make this work if the following code would run, but it
generates an error. This is the kind of cell-by-cell test I'd like to
perform. Can anyone suggest better syntax? Thanks!
Sub test()
Dim rCell As Range
For Each rCell In ActiveSheet.UsedRange
If rCell.Validation.InCellDropdown = True Then 'THIS LINE GENERATES
THE ERROR
MsgBox rCell.Address
End If
Next rCell
End Sub