Macro to filter copy and paste to another wor

 Sri -

I am a novice in macros.

I am trying to create a macro that finds a number in one workbook then goes to another workbook, filters the data using that number and copies and pastes the data of the selected rows back to the first workbook.

The data is in a spreadsheet called "Lines" (in one workbook). The other workbook with a spreadsheet called "Anlines".

In "Anlines" Row1 Column A is an account number.

I want to read this account number.
Goto the other workbook (spreadsheet "Lines") , filters the column "J" to find this account number.

Then copies all the filtered rows into the "Anlines" spreadsheet starting from 3rd row.

Is it possible?

Thanks for your help.


3 replies

Thanks for that but the two files/workbooks already exist and I am looking for the actual macro that will cut and paste between the workbooks.

Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

hi there,

follow these steps:

1. Go to Start>


Microsoft office>

Microsoft Excel to open the application.

Then, go to Start>New to open a new spreadsheet.

Go to File>Save as and save the new file before going

2. Go to Tools>


and a pop up window named security will appear.

Select the Medium option under the Security Level tab and click OK to continue.

3. Go to Tools>Macro>Record New Macro.

4.In this step, you will record the macro.

You will see a tiny pop up window that will appear with a blue button you can press this blue button at any time to stop recording the steps

you will find two Macros in the same VB Script file, so you can select first and copy the code and then go to another macro and select( you will find in the same script file) paste it.