Hello Mr.Excel Board!
This is my first post and apologize if i am missing any formalities. I am using Office Excel 2010. Below is code for what I am trying to do. I am so close but stuck.
I am trying to extract specific columns from a Workbook with many Worksheets into another NEW workbook on One single worksheet.
My problem is at the moment is at the ws.Range().Copy... i don't know what to fill in there to get the columns. Because i am using the COPY method, does that change the parameters?
Thank you Very much
This is my first post and apologize if i am missing any formalities. I am using Office Excel 2010. Below is code for what I am trying to do. I am so close but stuck.
I am trying to extract specific columns from a Workbook with many Worksheets into another NEW workbook on One single worksheet.
Code:
Sub SearchBurnerList()
Dim fileName As String: fileName = "C:\Users\...\Burner List.xls"
Dim ws As Worksheet
Dim wb As Workbook
Dim lastRow
lastRow = Range("A" & Rows.Count).End(xlUp).Row
Set wb = Workbooks.Open(fileName)
For Each ws In wb.Worksheets
ws.Range("A1", "B2").Copy _
ThisWorkbook.Sheets("SearchBook").Range("A" & Rows.Count).End(xlUp).Offset(1)
'ws.Range(Columns(1), Columns(2)).Select
' Selection.Copy ThisWorkbook.Sheets("SearchBook").Range("A" & Rows.Count).End(xlUp).Offset(1)
Next ws
'wb.Close False
End Sub
My problem is at the moment is at the ws.Range().Copy... i don't know what to fill in there to get the columns. Because i am using the COPY method, does that change the parameters?
Thank you Very much