Filter column A and copy column if cell in row has header
Is there a somewhat generic code that will filter column A for say x, y, z, then in copy each column that has a header for any of the filtered rows.
Where, for example:
row x with MyHdr in columns 2,4,6 (each column a different length) would copy 2,4,6 to sheet mySheet
row y with MyHdr in columns 3,7,9 (each column a different length)would copy 3,7,9 to sheet mySheet next to row x data.
row z with MyHdr in columns 2,6 (each column a different length)would copy 2,6 to sheet mySheet next to row y data.
I can manually filter a sheet as I say above, and see what columns I need to copy but don't know how to code the copy of each column. I think I want to stay away from B:B.Copy, F:F.Copy and use .xlDown or .UsedRange.
And this would be for each sheet in myArray("..", "..", "..")
And MyHdr is in row 2 when it exists.
Howard
|