Hello,
I have a workbook that copy's 'relevant' columns from one sheet to the next (sheet1 to sheet2). I used the code below to accomplish this.
This works great but now the data inputted into sheet1 is not always in the same order. I'd like to write the code so that it searches for certain column headers and then copies that whole column and pastes it into sheet2. Can someone help me out with this?
Thanks!
I have a workbook that copy's 'relevant' columns from one sheet to the next (sheet1 to sheet2). I used the code below to accomplish this.
Code:
With Worksheets("Sheet1")
.Range("B1", .Range("B" & Rows.Count).End(xlUp)).Copy Worksheets("Sheet2").Range("A1")
.Range("E1", .Range("E" & Rows.Count).End(xlUp)).Copy Worksheets("Sheet2").Range("B1")
End With
This works great but now the data inputted into sheet1 is not always in the same order. I'd like to write the code so that it searches for certain column headers and then copies that whole column and pastes it into sheet2. Can someone help me out with this?
Thanks!