PC Review


Reply
Thread Tools Rate Thread

Click to add Values in a different Cell

 
 
New Member
Join Date: Jul 2010
Posts: 5
 
      31st Aug 2010
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.
 
Reply With Quote
 
 
 
 
Ian Ian is online now
Rocket Scientist
Ian's Avatar
Join Date: Feb 2002
Location: Manchester, UK
Posts: 16,071
 
      1st Sep 2010
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
 
Reply With Quote
 
New Member
Join Date: Jul 2010
Posts: 5
 
      1st Sep 2010
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Right click to change cell values Linn Pallesen Microsoft Excel Programming 3 1st Nov 2008 10:48 PM
Click on cell-calendar drops down-click on date-date fills cell. . =?Utf-8?B?R2Vvcmdl?= Microsoft Excel Setup 1 15th Apr 2005 08:22 AM
Web: Capturing the current cell values on double-click event of a datagrid Tony Fields Microsoft ASP .NET 0 9th Dec 2004 04:09 PM
Want to be able to click on a cell and have a list box appear to give values to populate a cell Richard Zellmer Microsoft Excel Programming 2 16th Sep 2003 11:12 PM
Want to be able to click on a cell and have a list box appear to give values to populate a cell Richard Zellmer Microsoft Excel Discussion 2 16th Sep 2003 11:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:12 PM.