Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
m m is offline
external usenet poster
 
Posts: 64
Default Compiling data from several worksheets

Hi,
I am trying to compile data from several worksheets.
My base data are sheets sent to payroll for payment of different costs.
These are sent out every month so going through all sheets and filter and
then copy is not really an option.
Is there a macro that looks up whether or not a value is present in a row
and returns the whole row in a new spreadsheet? The value I am looking for is
€œIA3€.
The basic layout of the tables are as follows:
Reference €“ Payment type €“ Payment amount
Ideally it would copy the whole row if the value €œIA3€ is present to a new
spreadsheet and perhaps add the filename where it found it.
Thanks,
/m
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Compiling data from several worksheets

Can you be more precise.

1) Are you talking about multiple workbooks or worksheets. filename referes
to the workbook
2) Do you want to check every row in every worksheet of the workbook where
the macro is located.
3) Be specific about worksheet names to include or not include.

Macros can search through folder on your compter, go through all worksheets,
creatte new workbooks, create new worksheets.

"m" wrote:

Hi,
I am trying to compile data from several worksheets.
My base data are sheets sent to payroll for payment of different costs.
These are sent out every month so going through all sheets and filter and
then copy is not really an option.
Is there a macro that looks up whether or not a value is present in a row
and returns the whole row in a new spreadsheet? The value I am looking for is
€œIA3€.
The basic layout of the tables are as follows:
Reference €“ Payment type €“ Payment amount
Ideally it would copy the whole row if the value €œIA3€ is present to a new
spreadsheet and perhaps add the filename where it found it.
Thanks,
/m

  #3   Report Post  
Posted to microsoft.public.excel.misc
m m is offline
external usenet poster
 
Posts: 64
Default Compiling data from several worksheets

Hi,
Lets see what I can do. Ill try to be more precise.
1. The base data is contained in separate workbooks not worksheets.
2. I would like to check every row of every worksheet of the base data. Do I
have to copy the macro to these workbooks or will it run from the new
workbook?
3. The base data is contained in the worksheet €˜Sheet 1 in each of the
workbooks.
4. The workbooks are contained in a file structure that looks like this:

a. Payments
i. 2009
1. Jan
2. Feb
ii. 2008
1. Jan
2. Feb

I hope I have provided you with the data needed.
Every piece of help is appreciated.
/m


"joel" wrote:

Can you be more precise.

1) Are you talking about multiple workbooks or worksheets. filename referes
to the workbook
2) Do you want to check every row in every worksheet of the workbook where
the macro is located.
3) Be specific about worksheet names to include or not include.

Macros can search through folder on your compter, go through all worksheets,
creatte new workbooks, create new worksheets.

"m" wrote:

Hi,
I am trying to compile data from several worksheets.
My base data are sheets sent to payroll for payment of different costs.
These are sent out every month so going through all sheets and filter and
then copy is not really an option.
Is there a macro that looks up whether or not a value is present in a row
and returns the whole row in a new spreadsheet? The value I am looking for is
€œIA3€.
The basic layout of the tables are as follows:
Reference €“ Payment type €“ Payment amount
Ideally it would copy the whole row if the value €œIA3€ is present to a new
spreadsheet and perhaps add the filename where it found it.
Thanks,
/m

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Compiling data from several worksheets

I got very simila code working for somebody this morning that had the same
file structure as you. Put this code into a new summary workbook. the code
will automatically open/close all the workbooks in the file structure
(c:\payments) and put the results in the workbook with the macro. I copied
the old row to the new workbook starting in column B. Then put the filename
where the data came from in column A. I didn't test the code put I usually
get these type code right the 1st time especially after I copied 90% from a
previous posting.

Sub Combinebooks()

Root = "c:\Payments"
Set fso = CreateObject _
("Scripting.FileSystemObject")
Set folder = _
fso.GetFolder(Root)

Set SumSht = ThisWorkbook.ActiveSheet
RowCount = 1
For Each sf In folder.subfolders
FName = Dir(sf & "\*.xls")
Do While FName < ""
Set bk = Workbooks.Open(Filename:=sf & "\" & FName)
For Each sht In bk.Sheets
With sht
If .Range("IA3") < "" Then
LastCol = .Cells(3, Columns.Count).End(xlUp).Column
Set CopyRange = .Range("A3", .Cells(3, LastCol))
CopyRange.Copy _
Destination:=SumSht.Range("B" & RowCount)
SumSht.Range("A" & RowCount) = sf & "\" & FName
RowCount = RowCount + 1
End If
End With
Next sht
bk.Close savechanges:=False
FName = Dir()
Loop
bk.Close savechanges:=False

Next sf

End Sub




"m" wrote:

Hi,
Lets see what I can do. Ill try to be more precise.
1. The base data is contained in separate workbooks not worksheets.
2. I would like to check every row of every worksheet of the base data. Do I
have to copy the macro to these workbooks or will it run from the new
workbook?
3. The base data is contained in the worksheet €˜Sheet 1 in each of the
workbooks.
4. The workbooks are contained in a file structure that looks like this:

a. Payments
i. 2009
1. Jan
2. Feb
ii. 2008
1. Jan
2. Feb

I hope I have provided you with the data needed.
Every piece of help is appreciated.
/m


"joel" wrote:

Can you be more precise.

1) Are you talking about multiple workbooks or worksheets. filename referes
to the workbook
2) Do you want to check every row in every worksheet of the workbook where
the macro is located.
3) Be specific about worksheet names to include or not include.

Macros can search through folder on your compter, go through all worksheets,
creatte new workbooks, create new worksheets.

"m" wrote:

Hi,
I am trying to compile data from several worksheets.
My base data are sheets sent to payroll for payment of different costs.
These are sent out every month so going through all sheets and filter and
then copy is not really an option.
Is there a macro that looks up whether or not a value is present in a row
and returns the whole row in a new spreadsheet? The value I am looking for is
€œIA3€.
The basic layout of the tables are as follows:
Reference €“ Payment type €“ Payment amount
Ideally it would copy the whole row if the value €œIA3€ is present to a new
spreadsheet and perhaps add the filename where it found it.
Thanks,
/m

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
Compiling data from many work sheets to one justme Excel Discussion (Misc queries) 1 July 18th 07 11:09 PM
Compiling data from multiple worksheets into one worksheet thelonious419 Excel Discussion (Misc queries) 1 April 24th 06 06:16 PM
Data compiling formula FangYR Excel Worksheet Functions 3 February 4th 06 12:04 PM
Compiling Data Terry Bennett Excel Worksheet Functions 7 January 10th 06 10:56 PM
Compiling data Jason Sutter Excel Discussion (Misc queries) 0 October 12th 05 08:09 PM


All times are GMT +1. The time now is 02:31 AM.

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

About Us

"It's about Microsoft Excel"