MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Validation list

  Asked By: Diana    Date: Oct 01    Category: MS Office    Views: 1364

Anybody can give me a good vba script on this:
I have a validation list colum on 'A' , i will not permit the user to enter in
any cell if
"A" column is populated with this validation list data.



3 Answers Found

Answer #1    Answered By: Luz Hayes     Answered On: Oct 01

Please confirm what you want. Is it:

There are values in column  A
Entries can be made in any other column on the spreadsheet.
If an entry is made it must not match any of the items in column A.

What do you want to happen if a user  tries to put in a matching entry?
Message box? cancel the entry? colour it red?

Answer #2    Answered By: Vidos Fischer     Answered On: Oct 01

It will tell you not allowed to enter  in any column  unless the column 'A'
is populated.
By the way, column is is a drop-down list(Validation list). Message box is
display when this occurs. It is better if the you colored it red.

Answer #3    Answered By: Hoor Khan     Answered On: Oct 01

Try This

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) _
Is Nothing Then Exit Sub
If IsEmpty(ActiveSheet.Cells(Target.Row, 1)) _
And Target.Value <> "" Then
MsgBox "You must complete column  A first", vbOKOnly, "Error!"
Target.Value = ""
ActiveSheet.Cells(Target.Row, 1).Activate
End If
End Sub

Didn't find what you were looking for? Find more on Validation list Or get search suggestion and latest updates.