0

I have kind of the questionnaire. There is some identification number in the first column. The other three columns contain possible answers. I need to make sure that when I clicked on one of the cells under the columns with the answer options, an identification number appears in this row. I understand how this can be done for a specific case, but cannot extend this to all rows.

E.G. I have 2-10 numbers in A2-A10 rows. I also have B1-D1 column headers with answers. I clicked on B2 and "2" was put in B2 cell. In the next row I clicked D3 and "3" was put in D3 cell etc.

1 Answer 1

0

This helped me.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)       
If Not Intersect(Target, rng) Is Nothing Then
 With ActiveWindow
 actRow = ActiveCell.Row
 If ActiveCell.Value = Cells(actRow, 1) Then
    ActiveCell.ClearContents
 Else
    ActiveCell.Value = Cells(actRow, 1)
 End If
 End With
 End If
End Sub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.