Need help with Excel dynamic report

userx69

New Member
Joined
May 28, 2009
Messages
6
HI everybody I need to build up one dynamic report.

Here is the task:
1) Everyday workers fill up with records in each sheet (record count can be different, because there is a "List" table)
2) Each day is in one separate sheet (for example: 1st June is in sheet with name 1, 2nd June is in sheet with name 2 .)
3) ALL sheets are named 1, 2, 3 ... 31
4) And in the sheet with name "ALL records" must be generated all records from sheet 1,2, ... 31

Here is my Example

Could you :help: me please? :eeek:
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi and welcome to the board,

try this

Code:
Sub Copy_to_Master()
Dim sh1 As Integer, lastrow As Long, ws As Worksheet
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
sh1 = Worksheets("All Records").Index
For Each ws In Worksheets
lastrow = Worksheets(sh1).UsedRange.Rows.Count
If ws.Index <> sh1 Then
    ws.Activate
    ws.ListObjects(1).DataBodyRange.Copy
    Worksheets(sh1).Cells(lastrow + 1, 1).PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False
End If
Next ws
Worksheets(sh1).Activate
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
 
Upvote 0
your PM

userx69 said:
[FONT=&quot]Thank You for Your answer.[/FONT]
[FONT=&quot]But now I have to put a couple of sheets and I don't want to be included in your this macro (for example "Sheet1" and "Sheet2" macro must not include in its process). What I should put in your code? Help me again, please. ;)[/FONT]
Here is my example

try

Code:
Sub Copy_to_Master()
Dim sh1 As Integer, lastrow As Long, ws As Worksheet
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
sh1 = Worksheets("All Records").Index
For Each ws In Worksheets
lastrow = Worksheets(sh1).UsedRange.Rows.Count
If ws.Index <> sh1 and ws.name<>"Sheet1" and ws.name<>"Sheet2" Then
    ws.Activate
    ws.ListObjects(1).DataBodyRange.Copy
    Worksheets(sh1).Cells(lastrow + 1, 1).PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False
End If
Next ws
Worksheets(sh1).Activate
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
 
Upvote 0
Hi and welcome to the board,

try this

Code:
Sub Copy_to_Master()
Dim sh1 As Integer, lastrow As Long, ws As Worksheet
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
sh1 = Worksheets("All Records").Index
For Each ws In Worksheets
lastrow = Worksheets(sh1).UsedRange.Rows.Count
If ws.Index <> sh1 Then
    ws.Activate
    ws.ListObjects(1).DataBodyRange.Copy
    Worksheets(sh1).Cells(lastrow + 1, 1).PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False
End If
Next ws
Worksheets(sh1).Activate
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub

Thanks sanrv1f. If I follow this code, should I rename my sheets? pls advise...
 
Upvote 0
you need not rename your sheet, just change the below line to match your master sheet name

Rich (BB code):
sh1 = Worksheets("All Records").Index
 
Upvote 0
I have renamed my sheet as "All Records". But how to use this code. Can I paste it in new module. Pls advise, as I am not familiar with VBA.
 
Upvote 0

Forum statistics

Threads
1,223,634
Messages
6,173,477
Members
452,516
Latest member
archcalx

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