View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
arjen van der wal arjen van der wal is offline
external usenet poster
 
Posts: 24
Default Macro for Consolidation of Info from Different Tabs

If I've understood your question properly, the below should work. It takes
the data from each of the sheets in a workbook (except the first sheet) and
pastes it into the first sheet. It assumes that the data on the sheets begins
in the upper right (Range A1) and is continuous, which should be reasonable
since you mention they come from data tables. Give this a try:

Sub CopyDataLoop()

Dim wks As Worksheet
Dim r As Long

For Each wks In ThisWorkbook.Worksheets
If wks.Index = 1 Then
'nothing to do here
ElseIf wks.Index 1 Then

wks.Range("A1").CurrentRegion.Copy _
Destination:=Sheets(1).Cells(r + 1, 1)
r = Sheets("Sheet1").Range("A1").CurrentRegion.Rows.Co unt

End If

Next

End Sub