Try this without selections

Option Explicit
Sub consolidateSAS()
Dim ns As Long
Dim slr As Long
Dim dlr As Long
Dim i As Long

Application.ScreenUpdating = False
ns = Sheets.Count
Sheets.Add After:=Sheets(ns)
With ActiveSheet
.Name = "Consolidated Sheet"
.Range("A1") = "Name"
.Range("B1") = "Result"
.Range("C1") = "%Marks"
For i = 1 To ns
slr = Sheets(i).Cells(Rows.Count, 1).End(xlUp).Row
dlr = .Cells(Rows.Count, 1).End(xlUp).Row + 1
Sheets(i).Rows(2).Resize(slr).Copy .Cells(dlr, 1)
Next i
.Columns.AutoFit
End With
Application.ScreenUpdating = True
End Sub
============
-----Original Message----- From: naresh v
Sent: Wednesday, September 14, 2011 4:24 AM
To: excel-macros@googlegroups.com
Subject: $$Excel-Macros$$ how to consalidate from more sheets to one sheet

Hi Team,

I have a query, can you please tell me…

Q: How to link data from different sheets to one sheet ?
Ex: In attached excel there are 6 sheets.
Sheet1, Sheet2, Sheet3, Sheet4, Sheet5 and consolidated sheet.
I want to pull data into consolidate sheet from sheet1 to sheet5.
I have shown in the attached excel.





Thanks and Regards,
Naresh V,

--
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel
--
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to