Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to copy cols A, C and E from File A to cols A,B and C of File B ? 1

Status
Not open for further replies.

cubby2006

Programmer
Jan 29, 2006
1
US
I am developing an Access application and I want to create a spreadsheet named C:\FileB.XLS comprised of
3 columns from another speadsheet named C:\FileA.XLS .

Do you know of any VBA code that could take 3 columns from C:\FileA.XLS that has values as follows
and copy them into C:\FileB.XLS such that columns A, C and E are copied into columns A, B, C

I just want to copy the detail data, thus is it possible to bypass the first 2 rows which are not the actual data ?

File A layout:

A B C D E
1 plug
2 State Funds Account Tax ID Cusip #
3 Alabama 12 123456 99 5754456
4 Florida 14 765444 88 4556665

File B layout
A B(orig C) C(orig E)
1 Alabama 123456 5754456
2 Florida 765444 4556665

 
The easiest way to start might be to record yourself cutting and pasting the columns to a new workbook, then deleting the first two rows and saving with the desired name.

Tools,Macro, RecordNewMacro

Or simply delete the rows and columns you don't want and save with the new name.


Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top