Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default Looping through Worksheets to create Summary Page


I have a workbook with about 20 worksheets. The worksheets contain the same
column names. I would like a macro that would create a summary page based on
the 20 worksheets.

Can anyone help me?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,104
Default Looping through Worksheets to create Summary Page


Do you really need a macro?
Why not formulas such as:
=Sheet1!A1
=SUM('My First Sheet'!A1:A10)
=SUM('Alpha:Beta"!A1)
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Confused" wrote in message
...
I have a workbook with about 20 worksheets. The worksheets contain the
same
column names. I would like a macro that would create a summary page based
on
the 20 worksheets.

Can anyone help me?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default Looping through Worksheets to create Summary Page


I'm not quite sure what the formulas you gave me does. I need to consolidate
all the information from the 20 worksheets into one worksheet.

"Bernard Liengme" wrote:

Do you really need a macro?
Why not formulas such as:
=Sheet1!A1
=SUM('My First Sheet'!A1:A10)
=SUM('Alpha:Beta"!A1)
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Confused" wrote in message
...
I have a workbook with about 20 worksheets. The worksheets contain the
same
column names. I would like a macro that would create a summary page based
on
the 20 worksheets.

Can anyone help me?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Looping through Worksheets to create Summary Page


Here is one I did earlier today

Option Private Module
Sub consolidatesheetsSAS() 'SalesAid Software
Application.ScreenUpdating = False

With Sheets("consolidated")
..Rows("2:" & Cells(2, 1).End(xlDown).Row).Delete

For Each sh In ActiveWorkbook.Sheets

If sh.Name < "Consolidated" Then
dlr = .Cells(Rows.Count, 1).End(xlUp).Row + 1
slr = sh.Cells(Rows.Count, 1).End(xlUp).Row
If slr 1 Then sh.Cells(3, 1).Resize(slr, 12).Copy .Cells(dlr, 1)
End If

Next sh

..Columns("A:L").HorizontalAlignment = xlCenter
End With

Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Confused" wrote in message
...
I have a workbook with about 20 worksheets. The worksheets contain the
same
column names. I would like a macro that would create a summary page based
on
the 20 worksheets.

Can anyone help me?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default Looping through Worksheets to create Summary Page


Thanks Don. That works perfectly.
What if I need to exclude one worksheet from the summary page?

"Don Guillett" wrote:

Here is one I did earlier today

Option Private Module
Sub consolidatesheetsSAS() 'SalesAid Software
Application.ScreenUpdating = False

With Sheets("consolidated")
..Rows("2:" & Cells(2, 1).End(xlDown).Row).Delete

For Each sh In ActiveWorkbook.Sheets

If sh.Name < "Consolidated" Then
dlr = .Cells(Rows.Count, 1).End(xlUp).Row + 1
slr = sh.Cells(Rows.Count, 1).End(xlUp).Row
If slr 1 Then sh.Cells(3, 1).Resize(slr, 12).Copy .Cells(dlr, 1)
End If

Next sh

..Columns("A:L").HorizontalAlignment = xlCenter
End With

Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Confused" wrote in message
...
I have a workbook with about 20 worksheets. The worksheets contain the
same
column names. I would like a macro that would create a summary page based
on
the 20 worksheets.

Can anyone help me?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default Looping through Worksheets to create Summary Page


You could use
=Sheet1!A1
=Sheet2!A1
=Sheet3!A1
=Sheet41!A1
=sum(these four)
to get a consolidation
best wishes
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Confused" wrote in message
...
I'm not quite sure what the formulas you gave me does. I need to
consolidate
all the information from the 20 worksheets into one worksheet.

"Bernard Liengme" wrote:

Do you really need a macro?
Why not formulas such as:
=Sheet1!A1
=SUM('My First Sheet'!A1:A10)
=SUM('Alpha:Beta"!A1)
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Confused" wrote in message
...
I have a workbook with about 20 worksheets. The worksheets contain the
same
column names. I would like a macro that would create a summary page
based
on
the 20 worksheets.

Can anyone help me?





  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Looping through Worksheets to create Summary Page


dlr =destinationlastrow
slr=.......
Could name it anything NOT reserved to MS
could have been
JOE or Bill or SEX or ....

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Confused" wrote in message
...
Thanks. Can you tell me what "DLR" and "SLR" mean in the code you wrote?
I'm trying to understand the code and learn from this.



"Don Guillett" wrote:

If sh.Name < "Consolidated" and _
sh.Name < "othersheetname" Then

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Confused" wrote in message
...
Thanks Don. That works perfectly.
What if I need to exclude one worksheet from the summary page?

"Don Guillett" wrote:

Here is one I did earlier today

Option Private Module
Sub consolidatesheetsSAS() 'SalesAid Software
Application.ScreenUpdating = False

With Sheets("consolidated")
..Rows("2:" & Cells(2, 1).End(xlDown).Row).Delete

For Each sh In ActiveWorkbook.Sheets

If sh.Name < "Consolidated" Then
dlr = .Cells(Rows.Count, 1).End(xlUp).Row + 1
slr = sh.Cells(Rows.Count, 1).End(xlUp).Row
If slr 1 Then sh.Cells(3, 1).Resize(slr, 12).Copy .Cells(dlr, 1)
End If

Next sh

..Columns("A:L").HorizontalAlignment = xlCenter
End With

Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Confused" wrote in message
...
I have a workbook with about 20 worksheets. The worksheets contain
the
same
column names. I would like a macro that would create a summary page
based
on
the 20 worksheets.

Can anyone help me?





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
trying to create a way to link summary page to subsequent workshee girlsrope2 Excel Worksheet Functions 1 August 25th 08 10:16 PM
summary page of many worksheets frustrated scotstman Excel Discussion (Misc queries) 1 April 27th 08 03:26 AM
Summary page for 12 worksheets ACM Excel Discussion (Misc queries) 11 January 15th 08 12:06 PM
Create Summary List Page CB Excel Discussion (Misc queries) 3 March 29th 07 09:54 PM
How do I create a summary page? ssr Excel Programming 3 November 17th 03 04:07 PM


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

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

About Us

"It's about Microsoft Excel"