I attached a document containing some example data and a better description of what I want and where I want it to do. I hope someone can help me, as I have been at this for a few days and cannot get the results I desire.
Quick Rundown
A document will be downloaded and saved daily (Let's Call It: Doc1), containing some information.
Doc1's information is saved in 1 column (Let's Call It: D1C1) and the information is split up into cells below it.
I need a formula or macro that in another document (Let's Call It: Doc2) will search D1C1 for any cell beginning with a certain word (Let's Call It: Word1) and then copy those cells starting with Word1's entire information into a cell (Let's Call it: D2Cell1) in Doc2.
Also in either a seperate formula or macro or the same one, I need to copy the information that is 2 cells below Word1 (So if Word1 is in A1; it would also copy A3) in Doc1, and place the information in another cell (Let's Call it D2Cell2) which would be located either below or across D2Cell1.
Like I said the attached document contains an example with a description and example of the results I am after. Again, I hope someone can help me, many thanks to anyone who can do so.
Last edited by djyayo; 01-30-2011 at 03:26 PM.
Hi djyayo and welcome to the forum.
Based on your sample file the below macro will do what you want.
Sub ExtractAPlus2() Dim LastRowC As Double Dim LastRowE As Double Dim RowCtr As Double LastRowC = Cells(Rows.Count, "C").End(xlUp).Row For RowCtr = 4 To LastRowC If Left(Cells(RowCtr, "C"), 1) = "A" Or _ Left(Cells(RowCtr, "C"), 1) = "a" Then LastRowE = Cells(Rows.Count, "E").End(xlUp).Row Cells(LastRowE + 1, "E") = Cells(RowCtr, "C") Cells(LastRowE + 2, "E") = Cells(RowCtr + 2, "C") End If Next RowCtr End Sub
One test is worth a thousand opinions.
Click the * below to say thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks