LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default VB syntax to test for data validation in a cell

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
Test in Validation Box Very Small Font Size... cdavidson Excel Discussion (Misc queries) 1 May 18th 07 08:51 PM
Data Validation: Store cell address instead of value in the cell? WillW Excel Discussion (Misc queries) 1 January 31st 07 02:22 AM
Why does data validation not work when pasting data into a cell. rjshelby Excel Discussion (Misc queries) 1 July 31st 06 09:08 PM
Data Validation Syntax Question Jim & Gail Excel Discussion (Misc queries) 2 April 7th 05 04:17 AM


All times are GMT +1. The time now is 03:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"