Thread: Data Validation
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Data Validation

Here is code from a recorded macro

With Selection.Validation
.Delete
.Add Type:=xlValidateWholeNumber, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="0", Formula2:="50"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

Just change selectioion to the range your want

With Range("a5:D20").Validation
.Delete
.Add Type:=xlValidateWholeNumber, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="0", Formula2:="50"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

"muddan madhu" wrote:

Hi,

I received excel file every date to work on..
more than 100 row and it depends .....
how do create data validation macro for only for 100 row or 200 rows.

Actually I have used macro recorder to put validation & it validates
to whole column.
I dont want to put validation for whole column , i need only upto the
value available in corresponding column.

Thanks in advance