• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Saving the value of a cell into another by selecting the cell

weedguru13

New Member
Hi,


I want to save the value in a cell, into another cell by just clicking on/selecting it. So basically if i slelect C5, the value in C5 gets stored in F5 or something like that.

Also after something is stored in C5, if i now click on another cell (say C6) it gets stored in F6. And i repeat this process 'n' times after which it again comes back to C5. I am trying to use the worksheet change event but hasnt worked out.


Somebody help please.
 
Weedguru13


Can't you use Copy/Paste Values to do what you want?


What rules are there that define what goes where?
 
Hi, weedguru13!


The Worksheet_Change event is triggered when you change a cell value in that worksheet, not when you select (mouse or keyboard) a cell. For that you should use the Worksheet_SelectionChange Event.


Regards!
 
Taking what you said literally, this macro will put the value of the cell that you click on into the cell to the right of it. But as Hui and SirJB7 implied, there's probably more rules that need to be defined.

[pre]
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count = 1 And Target.Column <> Me.Columns.Count Then
Application.ScreenUpdating = False
Target.Offset(0, 1) = Target.Value
Application.ScreenUpdating = True
End If
End Sub
[/pre]
 
Back
Top