Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jen Jen is offline
external usenet poster
 
Posts: 119
Default Copy Columns from multiple workbooks

Hi,

I need a macro to copy columns from multiple workbooks into one, but into
separate worksheets.

I have budget files which have headers like product name, department, ID,
and quaterly buget (Q1'10, Q2'10, Q3'10........Q4'15), but the header order
is different in each file and they contain addtional information.
I just want to extract columns what I need.

Another problem is range of quaterly budget is different from each files.
Some files has Q1'09, but some don't. I need to copy all columns starting
"Q".

How can I do all this thing?

Thank you in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Copy Columns from multiple workbooks

Jen,

Sounds like there would be two parts to your program. The first would
identify the columns that need to be copied and the second part would
actually copy the columns.

If you are cycling through every worksheet in every open workbook, you can
use code similar to the following:

Public Sub test()

Dim bk As Workbook

For Each bk In Workbooks

For Each sht In bk.Sheets

Set rng = sht.Range("a1")

If Left(rng.Value, 1) = "Q" Then

'denote as column to be copied, or actually copy to
destination

End If

Next

Next

End Sub
--
Regards,
Eddie
http://www.HelpExcel.com


"Jen" wrote:

Hi,

I need a macro to copy columns from multiple workbooks into one, but into
separate worksheets.

I have budget files which have headers like product name, department, ID,
and quaterly buget (Q1'10, Q2'10, Q3'10........Q4'15), but the header order
is different in each file and they contain addtional information.
I just want to extract columns what I need.

Another problem is range of quaterly budget is different from each files.
Some files has Q1'09, but some don't. I need to copy all columns starting
"Q".

How can I do all this thing?

Thank you in advance.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare multiple columns in two workbooks? Ed Excel Programming 4 March 22nd 07 06:07 PM
Copy certain columns matching column A in two workbooks Chuckak Excel Programming 3 February 14th 07 05:28 AM
I want to multiple workbooks that have the same columns Khurum Excel Discussion (Misc queries) 5 September 23rd 06 10:18 PM
macro: copy multiple workbooks to multiple tabs in single book Michael Excel Programming 0 July 14th 06 04:53 PM
lookup a value from multiple columns of two workbooks Asad - Shareef Excel Worksheet Functions 2 May 9th 06 11:10 PM


All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"