How to extract data from one excel file to another

Closed
zamorin Posts 2 Registration date Tuesday September 10, 2013 Status Member Last seen September 11, 2013 - Sep 10, 2013 at 10:20 PM
zamorin Posts 2 Registration date Tuesday September 10, 2013 Status Member Last seen September 11, 2013 - Sep 11, 2013 at 03:10 AM
How do I extract data from one excel file to create a report in another excel file template?

The input file has various data fields. I need to extract 6 of the fields to create the report. Can I also group them in different tabs? Thank you.

2 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Sep 11, 2013 at 02:37 AM
sample data is like this

hdng1 hdng2 hdng3 hdng4
62 62 62 62
62 62 62 62
62 62 62 62
62 62 62 62
62 62 62 62
62 62 62 62

try this macro on this data and see sheet 2. if ok modify macro

Sub Test()
Dim r As Range
Dim aarea As Range
Worksheets("sheet2").Cells.Clear
Worksheets("sheet1").Activate
Set r = Range("B1:B1,D1:D1")
For Each aarea In r.Areas
aarea.EntireColumn.Copy
Worksheets("sheet2").Cells(1, Columns.Count).End(xlToLeft).Offset(0, 1).PasteSpecial
Next aarea
Application.CutCopyMode = False
End Sub
1
zamorin Posts 2 Registration date Tuesday September 10, 2013 Status Member Last seen September 11, 2013
Sep 11, 2013 at 03:10 AM
Thanks a lot Venkat. That works. Now the problem is:

I have an excel file coming from a bank I need to extract the 6 columns to a new excel file. The banks have a 3 alphabet code for each branch. According to the branch code, the data should go into the respective tab in the new excel file.

ie: KLG records goes to KLG tab on the excel with the relevant details of the record included.

Thanks.
0