Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default Another Data Validation question

Hello,

With Range("e5").Validation
.Add Type:=xlValidateWholeNumber, _
AlertStyle:=xlValidAlertInformation, _
Minimum:="5", Maximum:="10"
.InputTitle = "Integers"
.ErrorTitle = "Integers"
.InputMessage = "Enter an integer from five to ten"
.ErrorMessage = "You must enter a number from five to ten"
End With

This above code will Add Data Validation to a Cell.

Is their a way to then retrieve back what Type it is ?

For example from the above code it is being set to the Type of
"xlValidateWholeNumber". How can this later on be retreived so I can tell
what type it is ?

Something like strType = Cells(5,5).Validation.Type
'Notes this does not work but something like this is what I am looking for.

Any help would be greatly appreciated.

Thank you,
Jeff



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Another Data Validation question

You can get the type but it will come back as the number represented by the
constant. Whole number 1, Decimal 2, ...

Sub test()

MsgBox ActiveSheet.Range("E5").Validation.Type
End Sub
--
HTH...

Jim Thomlinson


"Jeff" wrote:

Hello,

With Range("e5").Validation
.Add Type:=xlValidateWholeNumber, _
AlertStyle:=xlValidAlertInformation, _
Minimum:="5", Maximum:="10"
.InputTitle = "Integers"
.ErrorTitle = "Integers"
.InputMessage = "Enter an integer from five to ten"
.ErrorMessage = "You must enter a number from five to ten"
End With

This above code will Add Data Validation to a Cell.

Is their a way to then retrieve back what Type it is ?

For example from the above code it is being set to the Type of
"xlValidateWholeNumber". How can this later on be retreived so I can tell
what type it is ?

Something like strType = Cells(5,5).Validation.Type
'Notes this does not work but something like this is what I am looking for.

Any help would be greatly appreciated.

Thank you,
Jeff



Reply
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
Data Validation Question Bob Myers Excel Worksheet Functions 1 December 18th 09 04:20 AM
Data Validation Question SiH23 Excel Discussion (Misc queries) 3 August 11th 07 11:29 PM
Data Validation Question? mastermind Excel Worksheet Functions 2 December 22nd 06 05:26 PM
Data validation question Tom Excel Programming 2 October 2nd 04 01:50 AM
Data Validation Question Minitman[_4_] Excel Programming 2 September 23rd 04 07:28 PM


All times are GMT +1. The time now is 06:49 AM.

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

About Us

"It's about Microsoft Excel"