PC Review


Reply
Thread Tools Rate Thread

Copying dada from multiple workbooks into 1 workbook

 
 
Jasonm
Guest
Posts: n/a
 
      16th Dec 2007
I tried searching here for an answer to this problem, but didn't find what
seemed like an appropriate solution... (Unless I am looking at it wrong...)
I have a folder with over 360 files I need to copy A to C and colums AE, AG,
AI and AK if data is present in these colums I would like to append that
data to another workbook in cells A - G (I think those column counts
match...)
I have tried several attempts at a macro to do this, but think VBA from the
file I am filling with data is my best bet. Is there an example of this out
there?
I will keep plugging away at this, and will post any resuts here to this
group.

Thanks for any help that you can offer! Jason


 
Reply With Quote
 
 
 
 
Jasonm
Guest
Posts: n/a
 
      16th Dec 2007
Sorry for the typo in the previous header! My fingers aren't nearly as fast
as my brain...

I have written the code to cycle through all of the files in the folder
(attached below) I think that I can copy the ranges that I want, but...
(there is always a but) I cannot find the last row of data (it will be
different in each workbook.

Jason

For intYear = 2006 To 2007

For intMonth = 1 To 12

For intDay = 1
To 31
strFileName
= intYear & " " & Format(intMonth, "00") & " " & Format(intDay, "00") _
& "
0000 (Wide).dbf"

With
Application.FileSearch

.LookIn = strDirectoryPointer

.Filename = strFileName
If
..Execute > 0 Then
'
enter code here to copy and paste desired cells into working file
'
This is Extra from cut and paste...
MsgBox
"There were " & .FoundFiles.Count & _
"
file(s) found."

For i
= 1 To .FoundFiles.Count
MsgBox
..FoundFiles(i)

Next i
Else
MsgBox
"There were no files found."


End If
End
With
Next intDay

Next intMonth

Next intYear


"Jasonm" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I tried searching here for an answer to this problem, but didn't find what
>seemed like an appropriate solution... (Unless I am looking at it wrong...)
> I have a folder with over 360 files I need to copy A to C and colums AE,
> AG, AI and AK if data is present in these colums I would like to append
> that data to another workbook in cells A - G (I think those column counts
> match...)
> I have tried several attempts at a macro to do this, but think VBA from
> the file I am filling with data is my best bet. Is there an example of
> this out there?
> I will keep plugging away at this, and will post any resuts here to this
> group.
>
> Thanks for any help that you can offer! Jason
>



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      16th Dec 2007
Ron Debruin has about every type of copy macro there is. Check his site out:

http://www.rondebruin.nl/tips.htm

"Jasonm" wrote:

> I tried searching here for an answer to this problem, but didn't find what
> seemed like an appropriate solution... (Unless I am looking at it wrong...)
> I have a folder with over 360 files I need to copy A to C and colums AE, AG,
> AI and AK if data is present in these colums I would like to append that
> data to another workbook in cells A - G (I think those column counts
> match...)
> I have tried several attempts at a macro to do this, but think VBA from the
> file I am filling with data is my best bet. Is there an example of this out
> there?
> I will keep plugging away at this, and will post any resuts here to this
> group.
>
> Thanks for any help that you can offer! Jason
>
>
>

 
Reply With Quote
 
Jasonm
Guest
Posts: n/a
 
      16th Dec 2007
Thanks, I'll give him a look!

Jm

"JLGWhiz" <(E-Mail Removed)> wrote in message
news:A12084A3-F461-4143-BEA3-(E-Mail Removed)...
> Ron Debruin has about every type of copy macro there is. Check his site
> out:
>
> http://www.rondebruin.nl/tips.htm
>
> "Jasonm" wrote:
>
>> I tried searching here for an answer to this problem, but didn't find
>> what
>> seemed like an appropriate solution... (Unless I am looking at it
>> wrong...)
>> I have a folder with over 360 files I need to copy A to C and colums AE,
>> AG,
>> AI and AK if data is present in these colums I would like to append that
>> data to another workbook in cells A - G (I think those column counts
>> match...)
>> I have tried several attempts at a macro to do this, but think VBA from
>> the
>> file I am filling with data is my best bet. Is there an example of this
>> out
>> there?
>> I will keep plugging away at this, and will post any resuts here to this
>> group.
>>
>> Thanks for any help that you can offer! Jason
>>
>>
>>



 
Reply With Quote
 
Jasonm
Guest
Posts: n/a
 
      16th Dec 2007
Thanks again, he did have just teh thing. Unfortunately I had too much data
to fit excel... I'll have to move to access.

Thanks again,

Jm

"JLGWhiz" <(E-Mail Removed)> wrote in message
news:A12084A3-F461-4143-BEA3-(E-Mail Removed)...
> Ron Debruin has about every type of copy macro there is. Check his site
> out:
>
> http://www.rondebruin.nl/tips.htm
>
> "Jasonm" wrote:
>
>> I tried searching here for an answer to this problem, but didn't find
>> what
>> seemed like an appropriate solution... (Unless I am looking at it
>> wrong...)
>> I have a folder with over 360 files I need to copy A to C and colums AE,
>> AG,
>> AI and AK if data is present in these colums I would like to append that
>> data to another workbook in cells A - G (I think those column counts
>> match...)
>> I have tried several attempts at a macro to do this, but think VBA from
>> the
>> file I am filling with data is my best bet. Is there an example of this
>> out
>> there?
>> I will keep plugging away at this, and will post any resuts here to this
>> group.
>>
>> Thanks for any help that you can offer! Jason
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying a range of data multiple times from multiple workbooks sot Microsoft Excel Programming 1 23rd Nov 2009 10:21 PM
copying sheet1 from different workbooks contained in a folder to myone and only destination workbook. Jeff Microsoft Excel Programming 3 15th Apr 2009 07:24 PM
Copying select data frm one workbook to multiple workbooks & save =?Utf-8?B?UG1hbg==?= Microsoft Excel Programming 7 2nd Oct 2007 03:08 PM
Copying Several Workbooks into one Workbook as Worksheets =?Utf-8?B?Qmx1ZV9DcnlzdGFs?= Microsoft Excel New Users 1 26th May 2005 02:19 PM
Excel Copying whole Sheets from mulitple workbooks, to a target workbook Allen Microsoft Excel Programming 5 15th Mar 2004 09:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:50 AM.