Consolidate data from sheet name "Route sheet" from 15 workbooks

Vijaya Kanthi

New Member
Joined
Jul 27, 2018
Messages
14
Hello,

Good day

I have 15-20 workbooks, where in in every workbook the 2nd sheet name would be " Route sheet ". I want a Macro which can consolidate all the data from these workbooks in the same formate.

All 15-20 workbook " route sheet " formate will be same.

can any one help me in this ???

Help would be much appriciated

Regads,
K
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
try the following codes
Sub general()
Dim z As Long, e As Long, G As Long, d As Long, h As Long
Dim f As String
d = 2
Sheets("Sheet1").Select
Cells(1, 1) = "=cell(""filename"")"
Cells(1, 2) = "=left(A1,find(""["",A1)-1)"
Cells(2, 1).Select
f = Dir(Cells(1, 2) & "*.xls")
Do While Len(f) > 0
ActiveCell.Formula = f
ActiveCell.Offset(1, 0).Select
f = Dir()
Loop
z = Cells(Rows.Count, 1).End(xlUp).Row
For e = 2 To z
If Cells(e, 1) <> ActiveWorkbook.Name Then
Cells(1, 4) = "=COUNTA('" & Cells(1, 2) & "[" & Cells(e, 1) & "]Sheet1'!A:A)"
Cells(d, 2) = Cells(e, 1)
For h = 1 To Cells(1, 4)
For G = 1 To 10
Cells(1, 3) = "='" & Cells(1, 2) & "[" & Cells(e, 1) & "]route sheet'!" & Chr(G + 64) & h
Cells(d, G + 2) = Cells(1, 3)
Next G
d = d + 1
Next h
End If
d = d + 1
Next e
MsgBox "collating is complete."
End Sub
It may pull only one line of data. may be opening each file and say .usedrange.copy is a better choice
Ravi shankar
 
Upvote 0
Hello,

Thanks for the macro...

however i have few issues with output.....

all the 15 spread sheet are not consolidating in this... it is getting in few wrrokbooks and the indicatior is at
Cells(1, 4) = "=COUNTA('" & Cells(1, 2) & "[" & Cells(e, 1) & "]Sheet1'!A:A)"

also, the data is conslidating is onyl for 10 colums.. i have data till 15 colums

kindly advice

thanks,
K
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top