elvagonumero1
New Member
- Joined
- Apr 24, 2012
- Messages
- 15
Hello Guys!
I've been searching a lot looking for a solution to my problem and seems like this problem has been solved a lot out there, but those solutions doesn't apply to my case or i'm surely missing something.
I'm making a dashboard that refreshes everything on it, depending on a date value set on a cell via drop-down menu, after that I need that all pivot tables on the workbook be updated with the the date mentioned before, until now everything's alright but when I try to set the filter with the date value it give a 1004 error
I've tried three alternatives that are commented below
Look at it please
I hope someone can help me with this.
Thanks in advance
I've been searching a lot looking for a solution to my problem and seems like this problem has been solved a lot out there, but those solutions doesn't apply to my case or i'm surely missing something.
I'm making a dashboard that refreshes everything on it, depending on a date value set on a cell via drop-down menu, after that I need that all pivot tables on the workbook be updated with the the date mentioned before, until now everything's alright but when I try to set the filter with the date value it give a 1004 error
I've tried three alternatives that are commented below
Look at it please
Code:
For Each Ws In ThisWorkbook.Sheets
If Ws.Name = "MAT_DIA" Or Ws.Name = "CLIENTES_DIA" Or Ws.Name = "VENTAS_ZONA" Or _
Ws.Name = "VEHÍ_DIA" Or Ws.Name = "ENT_DIA" Then
Set Td = Ws.PivotTables(1)
Set CampoTd = Td.PivotFields("FECHA DE LA VENTA (dd/mm/aaaa)")
CampoTd.ClearAllFilters
CampoTd.CurrentPage = Worksheets("DASHBOARD").Range("H6").value
'CampoTd.CurrentPage = DateSerial(Year(Worksheets("DASHBOARD").Range("H6").Value), _
Month(Worksheets("DASHBOARD").Range("H6").Value), Day(Worksheets("DASHBOARD").Range("H6").Value))
'CampoTd.CurrentPage = CStr(Worksheets("DASHBOARD").Range("H6").Value)
'CampoTd.CurrentPage =CLng(Worksheets("DASHBOARD").Range("H6").Value)
End If
Next Ws
I hope someone can help me with this.
Thanks in advance