• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Data validation problem

DJ

Member
Hi All,


I have a problem with data validation and unable to find its solution.


I have an excel sheet which I am unable to upload for your reference but Lets say column-A has names, Column-B has mobile numbers and column-C has a drop down list from where person need to choose city name.


Now what I want is if person fills column-A value and Column-B value he/she must choose a city from the drop down in column-C i.e. he/she can't leave it blank.


Please help me.

DJ
 
Good day DJ


This link will help


http://www.contextures.com/xlDataVal02.html


and by using error alert in data validation it will force users to enter a choice
 
Hi Bobhc,


Thank you for your response.


My problem was not related to Dependent Data validation. Instead in my sheet user can enter any value and choose any value from the dropdown list. The problem was that once user has entered values in column-A and Column-B then he/she can't skip column-c value blank i.e. he is forced to select an item in column-c drop down list.


Thanks,

DJ
 
Force user to input value...I had similar kind of issues recently...


I used:-


In module -


Sub Force_user()


Dim i As Long

i = ActiveCell.Row - 1

If i = 0 Then Exit Sub


If Range("A" & i).Value <> "" and Range("B" & i).value <> "" And Range("C" & i).Value = "" Then

MsgBox "Please ensure City is selected."

Range("C" & i).Select

Exit Sub

End If


In the sheet where data are available:-

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Call Force_user

End Sub
 
Back
Top