• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Keep spacing between pivot tables

Gman

Member
Hello all I am beginning to make a dashboard but have run into an issue. I will have multiple pivot tables, and they will change in size as the month goes on. I want to keep the spacing between them the same at all times. I also need it to update the spacing automatically so when data for a new day gets added it shows that day and keeps the 3 spaces (rows 15,16,17) before next pivot starts.

Thanks in advance for the help.
Gman
 

Attachments

  • example.xlsx
    76.6 KB · Views: 5
Yeah that would be nice, unfortunately I have to format it to match another executive report :(. Thanks for the idea though.
 
Gman, Look attach file. (sheet122) Pivot Table.
 

Attachments

  • example (34).xlsx
    72.6 KB · Views: 19
Gman
... have to format it to match another executive report ...
and You have already ... ~122 sheets.
and just that range You need to something :(
with VBA it would be possible,
but if You need ~122 Pivots then it would be wild too!
 
Thank you for the reply AVK. Unfortunately there will be more columns in each pivot as I continue to build and I need to match the format of another report. So the pivot tables will need to be stacked one above the other. Again thank you for the try. I would be open to VBA as long as it updated automatically.
 
Hi vletm haha no I'm not sure why my excel has 122 sheets. I am using the new 2016 excel and it seems to always open with that many sheets not sure if its something with my computer or what. I will be putting all pivots on 2 sheets probably a total of 10-15 pivots. Thank goodness not 122!! ;) Do you think I would be better served posting this in the VBA forum?
 
Gman
Then You just google how to make those 122 10-15 Pivots with VBA ...
it's not so tricky thing! You can do it!
and
How would do You control next step?
if all (except 1st) Pivot-tables can be 'somewhere' - 'some width' and so on...
Ps. there are setting that how many sheets will there then You'll create new workbook
... maybe 1-3 would be better (no need to delete so many later).
 
vletm guess I am a little confused. I'm not wondering how to make the pivot tables just how to keep the spacing as the days continue to get added. I have searched google for VBA on it but not finding a lot. Thanks again for the help.
 
vletm guess I am a little confused. I'm not wondering how to make the pivot tables just how to keep the spacing as the days continue to get added. I have searched google for VBA on it but not finding a lot. Thanks again for the help.
Dear Gman, if you add data in sheet1,2,3 & in sheet122 in option tab >click on "Refresh all, auto update in pivot.
 
AVK I have added 4/11/17 data to pivots and refreshed but it did not keep the spacing between the tables. Rows 15,16, and 17 were blank but now Pivot 1 has taken row 15. I would like to find a way that as days are added there are always 3 spaces between the tables.
upload_2017-4-10_13-27-46.png
 
Gman
... and notice that 2yrs later, Your 15th Pivot will start from ... >10'000row.
but, You have hints to make it with VBA. (#11 Reply)
 
Hi Gman
A new vba way, (You really got me thinking on this problem !!!)
Put code in a module and run "Insert3Rows"

Code:
Sub Insert3Rows()
Application.ScreenUpdating = False

Call DeleteBlankRows
Dim lRow As Long
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next

Set WorkRng = Application.Selection

lRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
lRow = lRow + 1
Range("A1:A" & lRow).Select

For i = WorkRng.Rows.Count To 2 Step -1
    If WorkRng.Cells(i, 1).Value <> WorkRng.Cells(i - 1, 1).Value Then
        WorkRng.Cells(i, 1).EntireRow.Insert
        WorkRng.Cells(i, 1).EntireRow.Insert
        WorkRng.Cells(i, 1).EntireRow.Insert
    End If
Next
[A1].Select
Application.ScreenUpdating = True
End Sub
[\CODE]
[CODE]
Sub DeleteBlankRows()
Dim i As Long
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet122")

lRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
lRow = lRow + 1
Range("A1:A" & lRow).Select
    'We turn off calculation and screenupdating to speed up the macro.
    With Application
        .Calculation = xlCalculationManual
        .ScreenUpdating = False
    'We work backwards because we are deleting rows.
    For i = Selection.Rows.Count To 1 Step -1

        If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then
            Selection.Rows(i).EntireRow.Delete
        End If
    Next i
        .Calculation = xlCalculationAutomatic
        .ScreenUpdating = True
    End With
End Sub
[\CODE]
 
Thank you Derek! That is some serious looking code! Thank you for taking the time to do that. I will test it out and get back to you!
 
Back
Top