The code below makes sure that only one of the cells in the range("D16:E25") can contain any value, when any value/string is entered in one of the other cell's within this range, the code deletes all the others. (This part works fine, thanks to "Macro Man")
Now I'd like the code to copy(and paste to "B5") a value from a certain cell in Column B, this needs to be the the cell in the same row as the value in the range("D16:E16"). Tried the folowing code you can find below... but it didn't work. Does annyone knows a sollution for this? I'd prefer the workbook (cell "B5") to auto update, so without having to run macro's or press buttons.
If Not Intersect(Target, Range("D16:E25")) Is Nothing Then
If Target.Cells.Count > 1 Then
MsgBox "Please edit one cell at a time!"
Else
Application.EnableEvents = False
newVal = Target.Value
Range("D16:E25").ClearContents
Target.Value = newVal
a = ActiveCell
Application.EnableEvents = True
End If
End If
If a.Column = 4 Then
Range("B5") = Range(a).Offset(0, -2).Value
Else: Range("B5") = Range(a).Offset(0, -3).Value
End If
End Sub