Re: VBA Problem in Excel 97



Will definitely give it a try - thanks so much!


Harlan Grove wrote:
LoneStar wrote...
...
The macro works perfectly for anyone with Excel 2000 and higher (it was
built in 2002 and saved as a 97-2002 workbook). However, I have one
person that is using Excel 97 that is getting a run-time error on the
Selection.Sort portion of the macro. I attempted to save the file as
an Excel 95 with no joy to them.

Changing file formats has as little effect on VBA code (as long as it
remains in the file) as changing number formats has on underlying
values.

Is there a difference in the VBA for sorting the data in Excel 97 that
I am missing? Here is the macro in its entirety, Ithe RunTime error
that is found on Debug in 97 is the Selection.Sort on column B:
...

Yes. Microsoft added properties to the Sort method in Excel 2K.

Selection.Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
...

DataOption1 is what's causing the problem. Delete it.

.



Relevant Pages

  • Re: VBA Problem in Excel 97
    ... Selection.Sort portion of the macro. ... an Excel 95 with no joy to them. ... Changing file formats has as little effect on VBA code (as long as it ... Here is the macro in its entirety, Ithe RunTime error ...
    (comp.apps.spreadsheets)
  • Re: VBA Problem in Excel 97
    ... Selection.Sort portion of the macro. ... an Excel 95 with no joy to them. ... Changing file formats has as little effect on VBA code (as long as it ... Here is the macro in its entirety, Ithe RunTime error ...
    (comp.apps.spreadsheets)
  • Re: VBA: For Count, when count changes from cell to cell
    ... with Excel 2000. ... reporting Macro being unavailable. ... Sub CalculateI3() ... means that you can refer to it in a cell just like a built-in Excel function. ...
    (microsoft.public.excel.misc)
  • RE: Sorting macro needed on a protected sheet
    ... they all have Excel 2003, before reposting this thread as a new discussion to ... you will still be prompted to enter a password when running your macro even ... closing the password dialog box performed the sort macro anyway without ... Autofiltering can be restored without having to close & ...
    (microsoft.public.excel.programming)
  • Re: Exporting Hierarchy to Excel (Jack`s Macro)
    ... Now an empty Excel ... Sub dwn ... How exactly did you copy Jack's code into the VB editor? ... contains Jack's macro? ...
    (microsoft.public.project)