data from one worksheet to another

%3CLINGO-SUB%20id%3D%22lingo-sub-2005589%22%20slang%3D%22en-US%22%3Edata%20from%20one%20worksheet%20to%20another%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2005589%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20scenario%2C%20worksheet%201%20column%20A%20gets%20its%20data%20from%20worksheet2%20column%20A%2C%20I%20have%20linked%20the%20two%20so%20that's%20easy%2C%20but%20if%20I%20delete%20or%20add%20a%20row%20in%20between%20worksheet%202%20that%20doesnot%20get%20reflected%20in%20worksheet1%2C%20how%20do%20I%20achieve%20that%2C%20TIA.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2005589%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2005644%22%20slang%3D%22en-US%22%3ERe%3A%20data%20from%20one%20worksheet%20to%20another%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2005644%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F908025%22%20target%3D%22_blank%22%3E%40Garima15%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGetting%20data%20from%20one%20to%20another%20sheet%20can%20be%20better%20handled%20by%20Lookup%20formula%20either%20VLOOKUP%20or%20INDEX%20%26amp%3B%20MATCH%2C%2C%2C%20in%20case%20of%20delete%20you%20may%20wrap%20these%20with%20IFERROR.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnother%20is%20Paste%20Link%2C%2C!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EReply%20in%20case%20of%20further%20assistance%2C%20and%20better%20share%20the%20WB%20with%20us%20along%20with%20formula%2Fmethod%20U%20r%20trying%20so%20far.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2008426%22%20slang%3D%22en-US%22%3ERe%3A%20data%20from%20one%20worksheet%20to%20another%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2008426%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F93699%22%20target%3D%22_blank%22%3E%40Rajesh-S%3C%2FA%3Ethanks%20for%20replying%2C%20actually%20my%20requirement%20is%20very%20simple%2C%20vlookup%20is%20good%20for%20match%20n%20verify%20but%20I%20need%20to%20fill%203%20worksheets%20of%20similar%20nature%20from%20one%20point%2C%20I%20have%20attached%20excel%20snapshots%2C%20where%201.%20file%20has%203%20months%20activities%20for%20each%20month%20(dec-2020%2CJan-2021...)%2C%20the%20first%20column%20has%20all%20the%20activities%20listed%20for%20that%20month.%3C%2FP%3E%3CP%3E2.%20a%20worksheet%20I%20want%20to%20create%20such%20that%20first%20column%20of%20every%20month%20can%20be%20filled%2C%20updated%20through%20this%20one%20sheet%20otherwise%20any%20addition%20or%20deletion%20of%20activities%20needed%20to%20be%20updated%20for%20all%203%20months%20one%20by%20one.%3C%2FP%3E%3CP%3E3.%20adding%20a%20row%20in%20ActivtyList%20tab%20shd%20reflect%20in%20all%20three%3C%2FP%3E%3CP%3E4.%20similarly%20for%20deleting%20a%20row%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eto%20fill%20the%20first%20column%20for%20all%20months%2C%20I%20am%20linking%20the%20column%20A%20to%20ActivityList%20columnA%20using%20paste%20link%3C%2FP%3E%3CP%3Ehope%20there%20is%20simple%20scripts%20available%20to%20do%20this%20task%20since%20its%20not%20going%20to%20be%20huge%20data%20just%20a%20regular%20updates.%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EGarima.%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2008938%22%20slang%3D%22en-US%22%3ERe%3A%20data%20from%20one%20worksheet%20to%20another%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2008938%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F908025%22%20target%3D%22_blank%22%3E%40Garima15%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EThe%20most%20easiest%20is%20INDEX%20formula%3A%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEnter%20this%20in%20cell%20A2%20of%20destination%20sheets%2C%20and%20copy%20down%20till%20needed.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DINDEX(ActivitySheet!%24A2%3A%24A2%2C1)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EAs%20soon%20Activity%20Sheet's%20column%20A%20finds%20any%20change%20either%20Delete%20or%20New%20data%20or%20Updates%20all%20destinations%20sheets%20reflect%20them.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CEM%3EAnother%20is%20VBA%20macro%3A%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%0A%0ADim%20i%2C%20Lastrow%20As%20Long%0A%0AIf%20Target.Column%20%3D%201%20Then%0A%0A%0A%20%20%20%20Lastrow%20%3D%20Sheets(%22ActivitySheet%22).Range(%22A%22%20%26amp%3B%20Rows.Count).End(xlUp).Row%0A%20%20%20%20%0A%20%20%20%20Sheets(%22Destination1%22).Range(%22A2%3AA100%22).ClearContents%0A%20%20%20%20%0A%20%20%20%20For%20i%20%3D%20100%20To%20Lastrow%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20Sheets(%22ActivitySheet%22).Cells(i%2C%20%22A%22).EntireRow.Copy%20_%0A%20%20%0A%20%20%20%20%20Destination%3A%3DSheets(%22Destination1%22).Range(%22A%22%20%26amp%3B%20Rows.Count).End(xlUp)%0A%0A%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20Next%20i%0AEnd%20If%0A%0ARange(%22A1%22).Select%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3ESave%20this%20as%20Standard%20Module.%3C%2FLI%3E%3CLI%3ESave%20the%20WB%20as%20Macro%20Enabled%20*.xlsm.%3C%2FLI%3E%3CLI%3EYou%20need%20to%20write%20this%20code%20for%20every%20destination%20Sheet%2C%20where%20you%20want%20to%20copy%20value%20from%20Activity%20Sheet.%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E
New Contributor

I have a scenario, worksheet 1 column A gets its data from worksheet2 column A, I have linked the two so that's easy, but if I delete or add a row in between worksheet 2 that doesnot get reflected in worksheet1, how do I achieve that, TIA.

6 Replies

@Garima15 

 

Getting data from one to another sheet can be better handled by Lookup formula either VLOOKUP or INDEX & MATCH,,, in case of delete you may wrap these with IFERROR.

 

Another is Paste Link,,!

 

Reply in case of further assistance, and better share the WB with us along with formula/method U r trying so far.

@Rajesh-Sthanks for replying, actually my requirement is very simple, vlookup is good for match n verify but I need to fill 3 worksheets of similar nature from one point, I have attached excel snapshots, where 1. file has 3 months activities for each month (dec-2020,Jan-2021...), the first column has all the activities listed for that month.

2. a worksheet I want to create such that first column of every month can be filled, updated through this one sheet otherwise any addition or deletion of activities needed to be updated for all 3 months one by one.

3. adding a row in ActivtyList tab shd reflect in all three

4. similarly for deleting a row

 

to fill the first column for all months, I am linking the column A to ActivityList columnA using paste link

hope there is simple scripts available to do this task since its not going to be huge data just a regular updates.

Thanks,

Garima.

 

 

 

 

 
 
 

 

 

 

@Garima15 

 

The most easiest is INDEX formula:

 

Enter this in cell A2 of destination sheets, and copy down till needed.

 

=INDEX(ActivitySheet!$A2:$A2,1)

 

  • As soon Activity Sheet's column A finds any change either Delete or New data or Updates all destinations sheets reflect them.

Another is VBA macro:

 

Private Sub Worksheet_Change(ByVal Target As Range)

Dim i, Lastrow As Long

If Target.Column = 1 Then


    Lastrow = Sheets("ActivitySheet").Range("A" & Rows.Count).End(xlUp).Row
    
    Sheets("Destination1").Range("A2:A100").ClearContents
    
    For i = 100 To Lastrow
        
    Sheets("ActivitySheet").Cells(i, "A").EntireRow.Copy _
  
     Destination:=Sheets("Destination1").Range("A" & Rows.Count).End(xlUp)

        End If
    Next i
End If

Range("A1").Select
End Sub

 

  • Save this as Standard Module.
  • Save the WB as Macro Enabled *.xlsm.
  • You need to write this code for every destination Sheet, where you want to copy value from Activity Sheet.

@Rajesh-SThanks for the pointers as in VBA code, I am using that to achieve my requirement.

@Garima15 

 

I might suggest that you use the following formula in column A of all created sheets:

 

=INDEX(INDIRECT("ActivitySheet!$A"&ROW()):INDIRECT("ActivitySheet!$A"&ROW()),1)

 

I am thinking that if you have a sheet called "ActivitySheet", and in the first column A of that sheet called "ActivitySheet" you list all the activities on each row in that column A

 

THEN

 

in the other created sheets, you put the above formula in each row of column A,

 

then column A of all the created sheets will have the same as column A of the Sheet Called "ActivitySheet"

 

So that means that you can add or delete any row in the "ActivitySheet" and the created sheets will all have the same data in column A as is in column A of the "ActivitySheet".

@Garima15 

 

Happy to learn that the VBA code is working for you,,, now if you feel you may accept my post as Best Solution as well Like.

 

Keep asking in case any other issue.