excel macro

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Excel Macro

Excel Macro

resolvedResolved · Medium Priority · Version 2003

Hannes has attended:
No courses

Excel Macro

Hi,

I've recorded the following macro:

'''''''''''''''''''''''''''''''''''''''
Workbooks.Open Filename:= _
"C:\Data\Financial Planning Macro Building Project\A020 DEVELOPED MARKETS.xls"
Windows("Trans and Volumes.xls").Activate
Range("C7").Select

Sheets("Data Sheet").Select
Windows("A020 DEVELOPED MARKETS.xls").Activate

Application.Run "'A020 DEVELOPED MARKETS.xls'!MENU"
Application.Run "'A020 DEVELOPED MARKETS.xls'!ISSCTR"

Range("A4").Select
ActiveWorkbook.ShowPivotTableFieldList = True
ActiveSheet.PivotTables("PivotTable6").PivotFields("BRAND").CurrentPage = _
"MASTERCARD"
Range("BA23:BI24").Select
Selection.Copy
'''''''''''''''''''''''''''''''''''''''''''''''

My goal is once the macro is run to open antoher file and make changes on the pivot in that file and then to copy the result to the original file.

Everytime I run the macro it fails and show an error in the section which selects the pivot and changes the pivot fields.

I think this might have to do with the fact that the excel file is protected.

Any suggetions on how I can get this to run?

RE: Excel Macro

Hi Guys,

I found a way to buypass this issue with some creative programming.


 

Excel tip:

Apply Autosum with keyboard shortcut

If you press Alt and = at the same time, it applies autosum.

View all Excel hints and tips


Server loaded in 0.08 secs.