ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro works on some but not for all (https://www.excelbanter.com/excel-programming/432249-macro-works-some-but-not-all.html)

[email protected]

Macro works on some but not for all
 
We have VISTA on all the machines but one (XP) but all have office 2007.
Three of us can open this work book and run this macro. four of us can not.
We have a button named refresh that is suppose to run the following macro:

ActiveWorkbook.RefreshAll
Range("G6").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh
Range("G5").Select
Selection.Sort Order1:=xlDescending, Type:=xlSortLabels, OrderCustom:=1, _
Orientation:=xlTopToBottom
ActiveWindow.SmallScroll ToRight:=10
Range("N6").Select
ActiveSheet.PivotTables("PivotTable2").PivotCache. Refresh
Range("N5").Select
Selection.Sort Order1:=xlDescending, Type:=xlSortLabels, OrderCustom:=1, _
Orientation:=xlTopToBottom
ActiveWindow.SmallScroll ToRight:=7
Sheets("EPA Grant").Select
Range("H6").Select
ActiveSheet.PivotTables("PivotTable4").PivotCache. Refresh
Range("H5").Select
Selection.Sort Order1:=xlDescending, Type:=xlSortLabels, OrderCustom:=1, _
Orientation:=xlTopToBottom
Range("A5").Select
Sheets("MFE ").Select
Range("F5").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh
Range("F4").Select
Selection.Sort Order1:=xlDescending, Type:=xlSortLabels, OrderCustom:=1, _
Orientation:=xlTopToBottom
ActiveWindow.SmallScroll ToRight:=7
Sheets("FE QUERY").Select
Range("F5").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh
Range("F4").Select
Selection.Sort Order1:=xlDescending, Type:=xlSortLabels, OrderCustom:=1, _
Orientation:=xlTopToBottom
Sheets("Plant data").Select
ActiveWindow.SmallScroll ToRight:=-17
End Sub


When I clcik on the debug button it always highlights the first line. This
use to work for all of us now it chokes. Any ideas? Thank you in advance!


All times are GMT +1. The time now is 02:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com