PDA

View Full Version : Solved: Copy, merge and save to a new workbook



aloy78
08-18-2011, 10:51 PM
Hi,
I would like to create a report from two sheets. I only want to copy out the filtered values of the two sheets and merge them into one new worksheet.

File attached for reference.

mancubus
08-19-2011, 02:03 AM
Hi.

see attached file.

aloy78
08-21-2011, 07:43 PM
Hi.

see attached file.

:rotlaugh: :clap: Mancubus, ur the man :beerchug: .

mancubus
08-22-2011, 12:32 AM
:rotlaugh: :clap: Mancubus, ur the man :beerchug: .

wellcome. glad to help...

aloy78
08-24-2011, 12:47 AM
wellcome. glad to help...

Opss, mancubus. Just notice that there was a glitch. When I click on the new sheet. It prompt this error message; "Compile error: Sub or function not defined"
Then it shows me this code:



Private Sub Worksheet_SelectionChange(ByVal Target As Range) ' <- This one is highlighted.

If Target.Address = "$A$2" Then
Call
Copy_Filtered_Data_From_WSs ' <- This one is highlighted.
End If


End Sub

mancubus
08-24-2011, 01:24 AM
when i open the file from post #2, and select cell A2 it works on both worksheets.

did you somehow delete the module or code?

aloy78
08-24-2011, 07:45 PM
when i open the file from post #2, and select cell A2 it works on both worksheets.

did you somehow delete the module or code?

Hi mancubus, at first I thought I made some mistakes on my workbook. So I tried the file that you attached in this post and it gave me the same error message.

Then I tried the file on my other post. That works without a glitch.
So I copied that code out and compare it with the code on this post. I saw some similarities and some differences and I tried amending it but I guess I'm not very good at it :P hahaha.. I think I have grown more white hair from guessing it out :rotlaugh:

However if I re-safe the file, close it and reopen it then it has no error. But that kinda defeats the purpose right (saving it twice)