How to pass a value of a clicked cell to another cell in a different worksheet?

Guys,

How to pass a value of a clicked cell to another cell in a different worksheet?

Thank you!

[115 byte] By [Alexander72] at [2007-12-25]
# 1

Hello Alexander,

You need to eloborate on what you are trying to do to get a proper response.

You could try the worksheet_Change event, and then use the properties of the active cell but without knowing what you want to achieve and when to achieve it, it is difficult to answer

Chas

ChasAA at 2007-8-31 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 2

Use this in the module, it will pass the "formula" for clicked cell to sheet2 at A1. Use ActiveCell.Value if you want to value instead. You have to triger this macro by hand. About pass the value to a diffrent cell, just be creative.

sub PassData()

Sheets("sheet2").Range("A1").FormulaC1R1 = ActiveCell.FormulaC1R1

end sub

magicalclick at 2007-8-31 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 3

Hi Guys:

I work it out. It is very simple. one line of code is enough

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheet2.Cells(2, 2) = Sheet1.Cells(Target.Row, Target.Column)
End Sub

simply copy the sub to the sheet you want to click and change the receiving sheet number and cell address.

ChrisHou at 2007-8-31 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...