View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default Runtime error 438

Sandy,

Make it:

Validaion.Add Type:=xlValidateList, Formula1:="Boundary,Lost
Ball,Water,Unplay,Other"

hth,

Doug

"Sandy" wrote in message
...
I am getting a runtime error 438 at the line between asterisks - can anyone
tell me why?

For Each MyCell In Range("C71:K71")

If MyCell.Value = vbNullString Then

With MyCell.Offset(1)
.Validation.Delete
.Value = vbNullString
.Locked = True
End With

With MyCell.Offset(2)
.Validation.Delete
.Value = vbNullString
.Locked = True
End With

ElseIf MyCell.Value < "" Then

With MyCell.Offset(1)
.Locked = False
With .Validation
.Delete
.Add Type:=xlValidateList, Formula1:="Boundary,Lost
Ball,Water,Unplay,Other"
.IgnoreBlank = True
.InCellDropdown = True
End With
End With
End If

If MyCell.Offset(1).Value = vbNullString Then

With MyCell.Offset(2)
.Validation.Delete
.Value = vbNullString
.Locked = True
End With

ElseIf MyCell.Offset(1).Value < "" Then

With MyCell.Offset(2)
.Locked = False
.Validation.Delete
*******
.Add Type:=xlValidateList, Formula1:="Boundary,Lost
Ball,Water,Unplay,Other"
*******
.IgnoreBlank = True
.InCellDropdown = True
End With
End If

Next MyCell

Thanks
Sandy