My problem is that 'sometimes' the code in the Copy/Paste section is not pasting the correct value. I have multiple versions of this code attached to buttons that sets up the workbook different ways for different people, first doing all the filtering with the slicer caches, then copy/paste the values that the filters provided.
It seems like sometimes it will copy/paste a value from a previous filter, THEN, filter the data correctly, or maybe its putting the old copy value in memory to early and then pastes it rather than the newly filtered value....if that makes sense.
Where I see it most is when it copies AZ10 to BE1. AZ10 is where I always copy from, each macro (slicer filters) will drive a different value to AZ10, then I copy from AZ10 to BE1 thru BE14, depending on the macro that's being run. So if the previous value in AZ10 was 42002 and was copied to BE2, then I run the code below, it might copy 42002 to BE1 rather than the new value 314198.
Thanks,
Don
It seems like sometimes it will copy/paste a value from a previous filter, THEN, filter the data correctly, or maybe its putting the old copy value in memory to early and then pastes it rather than the newly filtered value....if that makes sense.
Where I see it most is when it copies AZ10 to BE1. AZ10 is where I always copy from, each macro (slicer filters) will drive a different value to AZ10, then I copy from AZ10 to BE1 thru BE14, depending on the macro that's being run. So if the previous value in AZ10 was 42002 and was copied to BE2, then I run the code below, it might copy 42002 to BE1 rather than the new value 314198.
Code:
Sub ALL_IT_Dashboard()
'
' ALL_IT_Dashboard Macro
'
With Sheets("Dashboard")
Range("A5:A19").Font.ColorIndex = 1 'Black
Range("U2").Font.ColorIndex = 3 'Red
' Range("A5").Font.ColorIndex = 3
End With
'
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
' .EnableEvents = False
End With
' Sheets("Dashboard").Select
ActiveWorkbook.SlicerCaches("Slicer_Client1").ClearManualFilter
ActiveWorkbook.SlicerCaches("Slicer_PPM").ClearManualFilter
ActiveWorkbook.SlicerCaches("Slicer_Billable_Type1").ClearManualFilter
' Sheets("2018FilteredProjectPivotbyClien").Select
ActiveWorkbook.SlicerCaches("Slicer_Client").ClearManualFilter
ActiveWorkbook.SlicerCaches("Slicer_PPM1").ClearManualFilter
ActiveWorkbook.SlicerCaches("Slicer_Billable_Type").ClearManualFilter
'Copy Break/Fix Hours to table for Chart
Worksheets("2018FilteredProjectPivotbyClien").Activate
Range("BS14").Select
Selection.Copy
Range("AZ8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "0"
'Copy Planned Hours to table for % of work calculation
Worksheets("2018FilteredProjectPivotbyClien").Activate
Range("AZ10").Select
Selection.Copy
Range("BE1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "0"
'Copy % of work value to Dashboard/Total_Res_Capacity worksheet
Worksheets("2018FilteredProjectPivotbyClien").Activate
Range("BG1").Select
Selection.Copy
Worksheets("Dashboard").Activate
'Sheets("Dashboard").Select
Range("AJ2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Worksheets("2018FilteredProjectPivotbyClien").Activate
ActiveWindow.ScrollColumn = 49
Worksheets("Dashboard").Activate
Range("I1").Select
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
' .EnableEvents = True
End With
MsgBox ("Successfully Completed the Task.")
End Sub
Thanks,
Don