Hello,
I am not an basic excel user but I know nothing about VBA and macros, so my question may sound silly.
I was finishing a pivot table and wanted the table to refresh automatically, I searched the net for a solution and followed this suggestion:
"Right click the tab of the worksheet that contains your source data and pivot table and select View Code. This will present you with a code module which is associated with this particular sheet. Type this:
Private Sub Worksheet_Change(ByVal Target As Range)
Me.PivotTables(1).RefreshTable
End Sub
It assumes that there is only one pivot table on your worksheet."
I did that and did not like the result. So I wanted to delete this code.
And now it starts the problem.
I managed to succesfully delete the middle line, but the first and the third are still there.
In the microsoft visual basic, when "general" is select on the top of the window in the dropdown menu, there is no code, but when I select worksheet, I can see the code. And the code apeears in every worksheet of every file that I open.
Does anybody know why this is happening, and how I can delete these 2 lines of code?
Thanks In advance.
Rod
I am not an basic excel user but I know nothing about VBA and macros, so my question may sound silly.
I was finishing a pivot table and wanted the table to refresh automatically, I searched the net for a solution and followed this suggestion:
"Right click the tab of the worksheet that contains your source data and pivot table and select View Code. This will present you with a code module which is associated with this particular sheet. Type this:
Private Sub Worksheet_Change(ByVal Target As Range)
Me.PivotTables(1).RefreshTable
End Sub
It assumes that there is only one pivot table on your worksheet."
I did that and did not like the result. So I wanted to delete this code.
And now it starts the problem.
I managed to succesfully delete the middle line, but the first and the third are still there.
In the microsoft visual basic, when "general" is select on the top of the window in the dropdown menu, there is no code, but when I select worksheet, I can see the code. And the code apeears in every worksheet of every file that I open.
Does anybody know why this is happening, and how I can delete these 2 lines of code?
Thanks In advance.
Rod