+ Reply to Thread
Results 1 to 12 of 12

Huge Macro Help, Not totaling correctly

  1. #1
    Registered User
    Join Date
    04-29-2016
    Location
    USA
    MS-Off Ver
    2013
    Posts
    92

    Huge Macro Help, Not totaling correctly

    So these Macros were made from someone on here. It stopped doing the totals right. If you go look at hospitality aide the 2019 Totals and 2018 Totals are under a date. I need them at the end of the report with the other totals. Does anyone know whats wrong?
    Attached Files Attached Files

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Huge Macro Help, Not totaling correctly

    I see the grand total for Hospitality Aide on row 907 showing hours and amounts for the dates indicated on row 6. The entries for Hospitality Aide appears to have stopped after March 2018. It is possible the position was eliminated. Whoever set the Split screen probably set it one row too high which makes the Hous and Amounts headers on row 7 hidden as a user scrolls down the table. The Grand Total for each category appears to be in the correct place as far as I can determine. I could not find a macro that calculates the entries, but I assume there must be one, since there were no formulas on the sheet.
    Last edited by JLGWhiz; 07-15-2019 at 07:31 PM.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    04-29-2016
    Location
    USA
    MS-Off Ver
    2013
    Posts
    92

    Re: Huge Macro Help, Not totaling correctly

    Quote Originally Posted by JLGWhiz View Post
    I see the grand total for Hospitality Aide on row 907 showing hours and amounts for the dates indicated on row 6. The entries for Hospitality Aide appears to have stopped after March 2018. It is possible the position was eliminated. Whoever set the Split screen probably set it one row too high which makes the Hous and Amounts headers on row 7 hidden as a user scrolls down the table. The Grand Total for each category appears to be in the correct place as far as I can determine. I could not find a macro that calculates the entries, but I assume there must be one, since there were no formulas on the sheet.
    Yes it was eliminated in 2018, but the last two columns in Hospitality Aide should be on 2018 total and the Grand Total line not under 2/26/18 & 3/12/18 Payroll. Is there a way to fix this? I have 3 other spreadsheets exactly like this but they are wrong in different departments. So I really want to find a solution.

    Thanks!

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Huge Macro Help, Not totaling correctly

    I don't really understand the problem, but since that position is no longer active, I think you could just manually copy the data you need to where you want it as a static reference. I still have not been able to find any code or formulas that control where the data is on the sheet.

  5. #5
    Registered User
    Join Date
    04-29-2016
    Location
    USA
    MS-Off Ver
    2013
    Posts
    92

    Re: Huge Macro Help, Not totaling correctly

    Quote Originally Posted by JLGWhiz View Post
    I don't really understand the problem, but since that position is no longer active, I think you could just manually copy the data you need to where you want it as a static reference. I still have not been able to find any code or formulas that control where the data is on the sheet.
    Attachment 632613

    In column BF 2018 Total is shows zero which is incorrect.

    But if you can't find where it pulls over then there is nothing we can do. Thank you for looking!

  6. #6
    Registered User
    Join Date
    04-29-2016
    Location
    USA
    MS-Off Ver
    2013
    Posts
    92

    Re: Huge Macro Help, Not totaling correctly

    Also it's an issue with Medical Records, Dietary Supervisor, and CNA Alzheimer. Each of these has the year total and the grand totals in the last column of there last pay which is incorrect.

  7. #7
    Registered User
    Join Date
    04-29-2016
    Location
    USA
    MS-Off Ver
    2013
    Posts
    92

    Re: Huge Macro Help, Not totaling correctly

    THIS THING IS ALL WRONG!

    On the pivot table it shows those payrolls in hospitality aide being for 3/11/19-4/22/19. The Report has them 1/2/18-2/12/18...

    UGH!!! THIS IS A NIGHTMARE

  8. #8
    Registered User
    Join Date
    04-29-2016
    Location
    USA
    MS-Off Ver
    2013
    Posts
    92

    Re: Huge Macro Help, Not totaling correctly

    I found the old post whre the guy made it. He said this is the Macro Copying from the Pivot Table.

    PHP Code: 
    Sub BuildReportHeaders()
    Sheet1.UsedRange.Clear 'clear old report
    Sheet2.Range("A2").Resize(3, Sheet2.UsedRange.Columns.Count).Copy Sheet1.Range("A4")
    lcol = Sheet1.Range("A6").CurrentRegion.Columns.Count

    With Sheet1.Range("A4:A6").Resize(, lcol)
                .Interior.Color = RGB(180, 180, 180)
                .Font.Bold = True
                .Offset(, 3).HorizontalAlignment = xlRight
    End With

    With Sheet1.Range("A6").End(xlToRight)                      '
    goto the last filled cell on row 6
        
    .Offset(-21).Value Left(.Offset(-21).Value4)    'go 2 rows up (row 4) and 1 col right and shorten the value to first 4 char (year)
        .Offset(-2, 2).Value = ""                               '
    Go 2 rows up and 2 col right and empty that cell
        
    .Offset(-11).Resize(12).Value "Total"             'Go 1 row up (row 5) and 1 col right resize range to 2 col and fill both cells with Total
        .Offset(, 1).Value = "Hours"                            '
    Stay on this row go 1 col right and change cell to Hours
        
    .Offset(, 2).Value "Amount"                           'Stay on this row go 2 col right and change cell to Amount
    End With

    With Sheet1.Range("A6").End(xlToRight)
        .Offset(-2, 1).Value = Left(.Offset(-2, 1).Value, 4)
        .Offset(-2, 2).Value = ""
        .Offset(-1, 1).Resize(1, 2).Value = "Total"
        .Offset(, 1).Value = "Hours"
        .Offset(, 2).Value = "Amount"
        '
    Set up total for all years
        
    .Offset(-23).Resize(12).Value ""
        
    .Offset(-13).Resize(12).Value "Total"
        
    .Offset(, 3).Value "Hours"
        
    .Offset(, 4).Value "Amount"
    End With

    Sheet1
    .Range("A4:C6").ClearContents

    End Sub 

  9. #9
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Huge Macro Help, Not totaling correctly

    In my opinion, you would be better off to start from scratch and build an etirely new database and code. I can't be any help to you with what you have. But maybe somebody else on the forum will take a shot at it.

  10. #10
    Registered User
    Join Date
    04-29-2016
    Location
    USA
    MS-Off Ver
    2013
    Posts
    92

    Re: Huge Macro Help, Not totaling correctly

    I am fine with re doing it and would greatly appreciate the help I have no idea where to begin! My Client wanted this like last week...
    Last edited by alesha711; 07-17-2019 at 01:43 PM.

  11. #11
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Huge Macro Help, Not totaling correctly

    Quote Originally Posted by alesha711 View Post
    I am fine with re doing it and would greatly appreciate the help I have no idea where to begin! My Client wanted this like last week...
    It is a mess, and the code in Post #8 does not deal with the numerical values on the worksheet. It only sets up headers and subheaders from what I can glean, and even that does not match the main worksheet. There is a lot missing from the file that was uploaded from what I can see, and it would be difficult for anybody to try and help you based on the data and macros containded in that file. But that is only my anaysis. Others might see something that I did not and might be able to help. Good luck.
    JLG

  12. #12
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Huge Macro Help, Not totaling correctly

    After taking an in depth look at the file I see that Macro 'BuildReportBody' is the one that handles the data and that it does it by using the slicers and pivot table of Sheet 2 (New-Pivot). But coding for tables and slicers is beyond my expertise, so I will get off this thread and maybe somebody with some smarts will pick up on it.
    regards, JLG

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Countif not totaling correctly
    By morerockin in forum Excel General
    Replies: 7
    Last Post: 02-14-2017, 02:53 PM
  2. Replies: 5
    Last Post: 08-21-2013, 12:55 PM
  3. [SOLVED] Help!: Sumproduct is not totaling correctly
    By Trigeek in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-14-2013, 06:40 PM
  4. Macro to filter a huge dataset
    By zilem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2011, 01:09 PM
  5. Macro causes huge file size
    By tdyl1969 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-28-2011, 06:35 AM
  6. macro: Totaling amounts by household name
    By Mr. Humble in forum Excel - New Users/Basics
    Replies: 11
    Last Post: 01-15-2008, 05:50 PM
  7. [SOLVED] huge huge excel file... why?
    By Josh in forum Excel General
    Replies: 12
    Last Post: 02-09-2006, 06:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1