PC Review


Reply
Thread Tools Rate Thread

collating/consolidating large amount of data in excel

 
 
just4joe03@yahoo.com
Guest
Posts: n/a
 
      23rd Feb 2007
Hi,
I have just conducted a survey and have recieved about 70 excel
workbooks containing the data i reqested in the survey. The data is
all contained in the same cells in each workbook. There are 3 sets of
data i need to collate from each of these workbooks. one is in the
cells F15:F31, the other is in M15:M31 and the last is in J40:J42. I
would like to collect all the data in the M cells from one workbook
and put them directly under the ones from another workbook and so on.
Is there an easy way of doing this? please bear in mind that i have no
clue how to use macros talkless of even run one. Would be grateful if
someone could help.


Thanks,
Joe.

ps; u guys are great for taking the time to help people like this.
Would like to help anyone if I could.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      26th Feb 2007
here is a simple macro that will work. Modify the code below as follows

1) Put all the xls files in 1 folder (directory). and change MyPath line
below to match directory. the program will open every xls file in the
directory.
2) Change sheetnames to mattch the sheet names in your worksheets


I put the F column data into column A
I put the J column data in column E
I put the M column data into column C


Sub GetData()

MyPath = "c:\temp\test_xls"
SourceSheetname = "Sheet1"
DestinationSheetname = "Sheet1"


JOffset = 0
FMOffset = 0

DestinationName = ThisWorkbook.Name
Set fs = Workbooks.Application.FileSearch
With fs
.LookIn = MyPath
.FileType = msoFileTypeExcelWorkbooks
.Execute
End With

For i = 1 To fs.FoundFiles.Count

MyfileName = fs.FoundFiles(i)
Workbooks.Open Filename:=MyfileName, ReadOnly:=True

' Removed pathname from file name so it can be referenced in this
program.
'Basic doesn't like the full pathname???? stupid microsoft
Do While (1)
CharPosition = InStr(MyfileName, "\")
If CharPosition > 0 Then
MyfileName = Mid(MyfileName, CharPosition + 1)
Else
Exit Do
End If
Loop




Workbooks(MyfileName).Worksheets(SourceSheetname).Range("F15:F31").Copy _

Destination:=Workbooks(DestinationName).Worksheets(DestinationSheetname). _
Range("A1").Offset(rowOffset:=FMOffset,
columnOffset:=0)



Workbooks(MyfileName).Worksheets(SourceSheetname).Range("M15:M31").Copy _

Destination:=Workbooks(DestinationName).Worksheets(DestinationSheetname). _
Range("C1").Offset(rowOffset:=FMOffset,
columnOffset:=0)


Workbooks(MyfileName).Worksheets(SourceSheetname).Range("J40:J42").Copy _

Destination:=Workbooks(DestinationName).Worksheets(DestinationSheetname). _
Range("E1").Offset(rowOffset:=JOffset,
columnOffset:=0)

FMOffset = FMOffset + 17
JOffset = JOffset + 3


Workbooks(MyfileName).Close SaveChanges:=False

Next i


End Sub

"(E-Mail Removed)" wrote:

> Hi,
> I have just conducted a survey and have recieved about 70 excel
> workbooks containing the data i reqested in the survey. The data is
> all contained in the same cells in each workbook. There are 3 sets of
> data i need to collate from each of these workbooks. one is in the
> cells F15:F31, the other is in M15:M31 and the last is in J40:J42. I
> would like to collect all the data in the M cells from one workbook
> and put them directly under the ones from another workbook and so on.
> Is there an easy way of doing this? please bear in mind that i have no
> clue how to use macros talkless of even run one. Would be grateful if
> someone could help.
>
>
> Thanks,
> Joe.
>
> ps; u guys are great for taking the time to help people like this.
> Would like to help anyone if I could.
>
>

 
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
large amount of data moving to excel Gshack Microsoft Excel Worksheet Functions 1 25th Jul 2008 01:57 PM
Best way to easily export large amount of data from Excel hmsawyer Microsoft Excel Misc 1 5th Apr 2008 08:14 PM
Transferring Large Amount of Data from Excel 2003 to Access 2003 SSweez@gmail.com Microsoft Access External Data 6 15th Jan 2007 01:26 PM
Deleting or cancelling large amount of data in excel giorus Microsoft Excel Discussion 2 13th Sep 2006 05:25 PM
how do i save a large amount of data in a worksheet excel 4 =?Utf-8?B?UmFuYQ==?= Microsoft Excel Worksheet Functions 2 13th Jun 2006 11:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:46 PM.