Click here to Skip to main content
15,921,295 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I have data in cell A2 in each sheet of workbook1 and master data in workbook2
I want macro to copy cell A2 of sheet1 of workbook1 and goto workbook2 and autofilter field 5 with values copied from workbook1. then copy the data except header, go to workbook1 and paste data below last visible cell in columnA. then go to sheet2 copy data from cell A2 and go to workbook2 and autofilter field5 copy and paste in same way, repeat the task till last sheet.

I,m very new to VBA and trying to learn, can you please help me.

every little help is much appreciated.

What I have tried:

i tried writting the codes in parts but I'm not able to paste values in filter which is coped from cell A of sheet1 of workbook1.

codes are
Sub Copy_Data()
Worksheets(ActiveSheet.Index + 2).Select


End Sub
Updated 15-Oct-18 1:01am

One of the best ways to learn how to do tasks like this is to use the macro record feature of Excel. Start the macro recorder, execute the steps you want, stop the macro recorder. You can now edit the recorded code and modify it as necessary for your own requirements.
Share this answer
Take a look at this tip: Copy Data Between Excel Sheets using VBA[^]. Use solution #2 and change to your needs.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900