Hi Forum,
I've had a tough time searching for a solution with Google. I don't quite know how else to phrase it.
I have an Excel workbook where users input data. In two of the columns, D and E, users select from in-cell dropdowns (data validation). Each column has three selections to choose from. When "Dual" is selected in column D, the selection for column E should always be "n/a". The problem is users have consistently been selecting "Vertical" in column E. There are thousands of rows of data and many of them have this mistake.
Since "Dual" and "n/a" always go together I want to make it so that when "Dual" is selected in column D, "n/a" is automatically put into column E. Here's what I have so far:
This gets me a Type mismatch error. I'd like to get this to work and if anyone knows how to do this with conditional formatting or data validation rather than a macro I'm fine with that. If you know how I can change all the wrong entries that are already in the worksheet without going through it line by line that would be nice too.
Thanks for your time.
-Nick
I've had a tough time searching for a solution with Google. I don't quite know how else to phrase it.
I have an Excel workbook where users input data. In two of the columns, D and E, users select from in-cell dropdowns (data validation). Each column has three selections to choose from. When "Dual" is selected in column D, the selection for column E should always be "n/a". The problem is users have consistently been selecting "Vertical" in column E. There are thousands of rows of data and many of them have this mistake.
Since "Dual" and "n/a" always go together I want to make it so that when "Dual" is selected in column D, "n/a" is automatically put into column E. Here's what I have so far:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ItemSelection As Range
Dim AngleOrVert As Range
Set ItemSelection = Intersect(Range("D2:D100000"), Target)
Set AngleOrVert = Intersect(Range("E2:E100000"), Target)
If ItemSelection Is "Dual" Then
AngleOrVert.Value = "n/a"
End If
End Sub
This gets me a Type mismatch error. I'd like to get this to work and if anyone knows how to do this with conditional formatting or data validation rather than a macro I'm fine with that. If you know how I can change all the wrong entries that are already in the worksheet without going through it line by line that would be nice too.
Thanks for your time.
-Nick