Hi
I have some code running under the Worksheet_Change function in object Sheet1 in a workbook. This code updates cells in sheet1 when data is pasted into sheet1. This works fine.
As a result of changes to sheet1 (occuring when user pastes data) I want the Pivot tables in sheet2 to refresh automatically (these pivot table summarise the data in sheet1).
I tried adding code directly to my code in Sheet1 object but got the error message saying 'subscript out of range'. Am guessing I cannot reference Sheet2 when I'm in the Sheet1 object???
I also tried adding this 'refresh' code to a module and then calling it from the code in Sheet1 object but again get 'subscript out of range'.
Where can I put this code to get it to work?
Cheers
Nick
I have some code running under the Worksheet_Change function in object Sheet1 in a workbook. This code updates cells in sheet1 when data is pasted into sheet1. This works fine.
As a result of changes to sheet1 (occuring when user pastes data) I want the Pivot tables in sheet2 to refresh automatically (these pivot table summarise the data in sheet1).
I tried adding code directly to my code in Sheet1 object but got the error message saying 'subscript out of range'. Am guessing I cannot reference Sheet2 when I'm in the Sheet1 object???
I also tried adding this 'refresh' code to a module and then calling it from the code in Sheet1 object but again get 'subscript out of range'.
Where can I put this code to get it to work?
Cheers
Nick