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?
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!
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.
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.
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.
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.
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(-2, 1).Value = Left(.Offset(-2, 1).Value, 4) '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(-1, 1).Resize(1, 2).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(-2, 3).Resize(1, 2).Value = "" .Offset(-1, 3).Resize(1, 2).Value = "Total" .Offset(, 3).Value = "Hours" .Offset(, 4).Value = "Amount" End With
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.
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
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
Bookmarks