ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   be validated or not validated in a cell (https://www.excelbanter.com/excel-programming/346215-validated-not-validated-cell.html)

x taol

be validated or not validated in a cell
 


In using vba,
i want to know application yes or no validation check of specific cell.

dim mycel as range
if mycel.validation = true then
msgbox "yes the cell have validation"
else
msgbox "no no, the cell is general."
endif

but, i don't know how to do.

*** Sent via Developersdex http://www.developersdex.com ***

Rowan Drummond[_3_]

be validated or not validated in a cell
 
One way:

Dim mycel As Range
Dim vald As Variant
Set mycel = Range("D2")
On Error Resume Next
vald = mycel.Validation.Type
On Error GoTo 0
If vald < Empty Then
MsgBox "yes the cell have validation"
Else
MsgBox "no no, the cell is general."
End If

Hope this helps
Rowan

x taol wrote:

In using vba,
i want to know application yes or no validation check of specific cell.

dim mycel as range
if mycel.validation = true then
msgbox "yes the cell have validation"
else
msgbox "no no, the cell is general."
endif

but, i don't know how to do.

*** Sent via Developersdex http://www.developersdex.com ***



All times are GMT +1. The time now is 11:39 PM.

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