Hi. I am not a programmer and have not used Visual Basic before so that's probably my first problem (!) but I am trying to debug a macro in a workbook that a former colleague created and having no luck. The macro is designed to update values in a summary table based on various scenario inputs which are user created. That is, I fill out the specific data for one of six economic scenarios and then select which scenario I want to run, click on the macro and it updates the summary spreadsheet.
I believe the macro was created in an older version of Excel (?) but I'm not sure (I am running 2003 SP3). The error I get when I attempt to run the macro is "Run-time error '438' Object doesn't support this property or object"
When I go to debug to following code appears:
' Macro4 Macro
ActiveWorkbook.Worksheets("Scenario Assumptions").Sort.SortFields.Add Key:= _
Range("D13:D18"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
With ActiveWorkbook.Worksheets("Scenario Assumptions").Sort
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
The first row that starts with 'ActiveWorkbook' is highlighted in yellow.
I have searched online and tried various fixes but nothing is working. If anyone can see an obvious fix here I would be hugely grateful!!