Remembering a value moving from one sheet to another

  • Thread starter Thread starter Hitesh_sethi
  • Start date Start date
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
 
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
 
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.
 
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
 

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

Back
Top