When I copy cells from one column only the pasted cells always have #N/A rather than the text they should have.
This happens when I either;
- Copy a range of cells including any in this one affected column (Column A)
- Copy a range of cells from only in the affected column
- Delete a row (all values on the next row for the entire length of the row then have #N/A
- Copy more than one cell from not in the affected column and paste any of them into the affected column
If I however copy a single cell from the affected column is pastes as it should. If I copy multiple cells from the affected column and paste them elsewhere in the sheet they paste OK.
I have zero idea how to solve this and searching on google did not help find an answer.
The cells in the affected column (Column A) are either standard text or are cells with a drop down list data validation type; None have formulas.
EDIT -
I have narrowed it down to the following code. The code is to change the value the user selects in the drop down list to something else.
Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice 20161026
selectedNa = Target.Value
If Target.Column = 1 Then
selectedNum = Application.VLookup(selectedNa,
Worksheets("refList_Hidden").Range("table_dropDown"), 2, False)
If Not IsError(selectedNum) Then
Target.Value = selectedNum
End If
End If
End Sub
I'm pretty sure the answer is to check if the range contains only one cell, if it does then run the VLOOKUP, if it contains more than one cell then then do not run the above code. Does anyone know how to do this?