Runtime error 438

S

Sandy

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
 
D

Doug Glancy

Sandy,

Make it:

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

hth,

Doug
 
S

Sandy

Don
Thank you
Wood and Trees spring to mind

Doug
I realised after I saw Don's comment
Thanks Doug

Sandy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top