Validation eradication

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

The following code is meant to eradicate a cell validation. The problem is I
have to select another cell first then reselect the cell the code was
carried out on.

Private Sub CommandButton1_Click()
With Selection.Validation
.Delete
ActiveWindow.SmallScroll Down:=1
ActiveWindow.SmallScroll Up:=1

End With
With Selection.Select
End With
End Sub


You will see I have tried to get around it by moving down one cell then up
again, but this does not work.

Thank you if you can be of help.
Pat
 
Hi Pat

I am sure somebody in this newsgroup will be able to get this to work
without the need to select another cell but in the meantime you could try:

Private Sub CommandButton1_Click()
With Selection
.Validation.Delete
.Offset(1, 0).Select
.Select
End With
End Sub

Hope this helps
Rowan
 

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

Back
Top