How to automatically transfer data from one cell in one worksheet to another cell in another worksheet in the same workbook

Somanna

When I select a particular cell in the 1st column the data from the cells in the 2nd and 3rd column of the same row as the selected cell should get transferred to a two particular cells in another worksheet. How do I do it?

For example consider two worksheets Sheet1 and Sheet2
Sheet1 Image enter image description here Sheet2 Image enter image description here

When I select cell A3 as selected in Sheet2 Image, the data in cell B3 should be automatically transferred to the cell E6 in Sheet1 and data in cell C3 in Sheet2 to cell B2 in Sheet1.

Please remember I might select any cell in column A in Sheet2.

Akina

Insert below code into data source sheet (Sheet2 on your screenshot) module:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' When selection on the worksheet is changed we check
' that only one cell is selected (not multicell range)
' and this cell is in column 1 (column A)
If Target.Column = 1 And Target.Cells.Count = 1 Then
    ' If one cell in column A selected, we copy the value 
    ' from a cell right to selected (row is the same, column is greater by 1)
    ' to the left-up cell of solid destination range on the destination sheet
    Sheets("Sheet1").Range("B2").Value = Target.Offset(0, 1).Value
    ' and the same for a cell where row is the same and column is greater by 2
    Sheets("Sheet1").Range("E6").Value = Target.Offset(0, 2).Value
End If
End Sub

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

how to copy a cell from one worksheet to another, to the correct row

VBA to Copy data from one workbook to another workbook/worksheet not working

Excel/VBA How to move data from one worksheet to another after last used cell?

Data extract from one worksheet to another worksheet

VBA loop to lookup ref in one worksheet and copy cell data to another

Input data from one workbook form into another workbooks worksheet

Is there a way to set one cell on one worksheet to equal one cell on another worksheet based on the value of a specific cell?

copy and paste a cell from one worksheet to another and multiply it by a value

Copying a worksheet from one workbook to another into an existing worksheet

How to move a worksheet from one workbook to another in VBA

How do I copy a worksheet from one workbook into another new workbook with just that worksheet in (with pastevalues)?

How to copy a specific range from one worksheet to another worksheet in another workbook

Hyperlinking a cell to another cell in the same worksheet

Reference a cell from another worksheet

Copying cell values from one Workbook into another

Having trouble copying data from one Worksheet to another Worksheet

Reference to cell in another worksheet

How to copy cell contents from multiple rows into one cell if 3 column values are the same within a worksheet?

How to auto update one worksheet from another?

How to paste data from one worksheet under changing data from another worksheet?

Hyperlinking multiple columns to the same cell in another worksheet

Find data in a column from a cell reference in another worksheet then copy some data to another worksheet

Embed worksheet into another worksheet in same workbook

What could be the VBA for copying some specific cell from one worksheet to another in Excel?

How to copy data from one worksheet to another (using an indirect reference for the latter worksheet)

Referencing a cell from another worksheet in excel

reference a cell from another worksheet using a variable

How to sum excel data in another worksheet, using the value of a reference cell

Make a worksheet active depending on value in cell from another worksheet