On click, copy text into another cell - XL2K

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying figure out how to copy text from a "list" (i.e., 4 or 5 text
entries in one column, but each in individual cells) to another cell in the
same spreadsheet by clicking on the original cell just once. The text always
needs to copy to the same final cell, but can change. For example, cells
A1:A3 contain "A1:small, A2:medium and A3:large". Clicking on one of these
pastes it into another cell, such as D1. Each time a different cell is
clicked in A1:A3, the text in D1 changes accordingly.

Any help is greatly appreciated.
 
Try pasting this procedure in the appropriate worksheet object code
sheet

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row = 1 And Target.Column = 1 Then
Range("d1") = Range("a1")
ElseIf Target.Row = 4 And Target.Column = 1 Then
Range("d1") = Range("a2")
ElseIf Target.Row = 7 And Target.Column = 1 Then
Range("d1") = Range("a3")
End If
End Sub

Good luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top