Click to add Values in a different Cell

Joined
Jul 14, 2010
Messages
5
Reaction score
0
Good day all.

I am trying to add a value from a specific range of values to a target cell by simply clicking one of the specific range of cells, i.e.

C2- Bill
C3- Bob
C4- Jim
C5- Mike
C6- Steve

I want to Click one of these cells and have the value in that cell show up in Cell A1

So clicking on C2 would add the value Bill to A1, then if i click C6 it would change the value in A1 to Steve etc.
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
Welcome to the forums zelle :)

I don't know much about Excel programming, but I'm pretty sure you'll have to use VBA programming to do what you are trying to achive. I'm sure there will be some source code for changing a value based on the active cell - so perhaps some googling will yield a result.

Good luck :)
 
Joined
Jul 14, 2010
Messages
5
Reaction score
0
Thank you,

I have since thought of that and developed the following code

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

If Not Intersect(Target, Range("C2:C6")) Is Nothing Then
Cancel = True
Range("A1") = Target.Value
End If

End Sub

It works beautifully. Thanks for the help!
 

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

Top