Searching, copying, and pasting data

Closed
Rob - Aug 19, 2010 at 04:30 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Sep 1, 2010 at 06:14 PM
Hello,

I Am trying to write a macro in VBA. I am trying to search for certain pieces of data in one sheet and move it to another sheet. Specifically, I have a list of data in Column A on Sheet 1. In Sheet 3, I am importing files (one text file at a time, clearing the contents before the next text file is imported). I want to search the data in Column A on Sheet 3 and see if the same data appears in Column A of Sheet 1. If it does, I want to copy the entire row in Sheet 3 and paste it in Sheet 2. I will be constantly updating the data in Sheet 1 and looking for the same data in Sheet 3 as I import the files. The data that is copied into Sheet 2 will need to continue onto the next rows so it isn't lost when a new text file is imported into Sheet 3. Thanks ahead of time for any help!


1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Aug 20, 2010 at 09:36 AM
Could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc
AND post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too.


Note:
your data need not be to be real data but a good representative of how data looks like
0
Here is the link: http://wikisend.com/download/590956/Example_data-1.xlsm

In Sheet1 Column A is the data that will need to be referenced when searching in Sheet3. Sheet3 is an uploaded file of data. Any of the data in Sheet1 Column A that is also listed in Sheet3 Column A is what I'm looking for. For example, Sheet1 Column has 5 in one of the cells. Sheet3 Column A also has 5 in one of the cells. Therefore, I would want the entire row in Sheet3 (in case, row 3) to be copied and pasted in Sheet2. In the case of the same number appearing multiple times, both rows would be copied and pasted. For example, Sheet1 Column A has 14 listed. In Sheet3 Column A, 14 appears in two different cells. Therefore, I would want both of these rows (6 and 7) copied and pasted into Sheet2. As you can see in the macro, the data in Sheet3 will be cleared the next time the macro is run and new data will be uploaded. The data in Sheet2 needs to stay however with more data being placed in the rows following the data that is already present. I don't have any problems with the macro uploading the file. I just need a macro for searching through the data as I described. Thanks for your help.
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Aug 26, 2010 at 08:21 AM
0
I see the similarities to the first one but I'm still having problems. It's just not working right.
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Sep 1, 2010 at 06:14 PM
What is not working right?
0