Remembering a value moving from one sheet to another

H

Hitesh_sethi

Hi

I am looking for a help in my case where i have an excel sheet. On
Sheet1 i have one column and 6-7 rows each having different text .Now
on sheet 2 of the same file there is a column where i want to populate
the value of the text selected on sheet 1.

eg
sheet1 has 6 diff entries like A,B,C,D,E,F and sheet 2 column is
empty.

Suppose i select B(Second Row) on sheet1 and go to Sheet2 then the data
populated there should be B, similarly if i change and select C(Third
Row) on sheet1 and go to sheet2 then teh data populated there should be
C.

Help me Pls ...

Hitesh
 
A

arthurjr07

You can only accomplished that by using VBA

Goto Tools>Macro>Visual Basic Editor.
In the project explorer, double click SHEET1

then paste this code to the coding area.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
Worksheets("Sheet2").Cells(Target.Row, Target.Column).Value =
Target
End Sub
 
H

Hitesh_sethi

I have pasted the code in the corresponding space but then also the
problem is not solved.

Dont i need to mention about the line no and the row no in the code.
 
A

arthurjr07

Hitesh_sethi,

when you copied and paste the code, does it change the color of the
text to RED.
the code should be 3 lines only. like this

Private Sub Worksheet_....., Cancel As Boolean)
Worksheets("Sheet2").Cells(Target.....= Target
End Sub

I hope u understand, what i am trying to explain.

I also forgot to mention, you have to double click the cell to transfer
the data from sheet1 to sheet2.

If you're still getting an error email me, so that i can email you a
sample excel. OK
 
Top