deletedalien
Well-known Member
- Joined
- Dec 8, 2008
- Messages
- 505
- Office Version
- 2013
- Platform
- Windows
Hi guys, so im trying to have several pivots change automatically depending on the user who's logged in, i have a named range called repid where the rep id will sit once the workbook is opened, But for whatever reason i cant get my macro to work,
here is what i have:
i also tried:
and neither codes work,
Any ideas??
thanks in advance for your help.
here is what i have:
Code:
Private Sub Workbook_Open()
Dim UserN As String
UserN = Environ("UserName")
Sheets("Rep Data").Range("E2").Value = UserN
Sheets("ISR Camp Overview All").Select
Range("F1").Value = Range("Repid")
Application.Calculate
Sheets("New Customers").Select
ActiveSheet.PivotTables("New_Customers").PivotFields("ISR").Value = Range("Repid")
Sheets("D03").Select
Application.CalculateFull
End Sub
i also tried:
Code:
Private Sub Workbook_Open()
Dim UserN As String
UserN = Environ("UserName")
Sheets("Rep Data").Range("E2").Value = UserN
Sheets("ISR Camp Overview All").Select
Range("F1").Value = Range("Repid")
Application.Calculate
Sheets("New Customers").Select
ActiveSheet.PivotTables("New_Customers").PivotFields("ISR").CurrentPage = Range("Repid")
Sheets("D03").Select
Application.CalculateFull
End Sub
Any ideas??
thanks in advance for your help.