I have two very simple macros in a spreadsheet (code copied below). I linked the macros to buttons for end users to change the data to a percent and back to a total number (see image below). I created this last year and want to replace the 'source data' with current data. I did not want to start over building the macros. Is it possible to change the data source and make sure the macros will still work? I tried on my own and it didn't work - which is why I am here. Also - I know zero about writing code and anything related to VBA. Simplistic vocabulary replies are appreciated.
For reference, here is an example of one of the macro codes (it is for a different worksheet - but the basics are the same):
Sub m_lev_grd_p()
'
' m_lev_grd_p Macro
'
'
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Count of Math Level")
.Calculation = xlPercentOfRow
.NumberFormat = "0.00%"
End With
End Sub
Sub m_lev_grd_t()
'
' m_lev_grd_t Macro
'
'
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Count of Math Level")
.Calculation = xlNormal
.NumberFormat = "General"
End With
End Sub
For reference, here is an example of one of the macro codes (it is for a different worksheet - but the basics are the same):
Sub m_lev_grd_p()
'
' m_lev_grd_p Macro
'
'
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Count of Math Level")
.Calculation = xlPercentOfRow
.NumberFormat = "0.00%"
End With
End Sub
Sub m_lev_grd_t()
'
' m_lev_grd_t Macro
'
'
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Count of Math Level")
.Calculation = xlNormal
.NumberFormat = "General"
End With
End Sub