ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro works in 2003, not in '97 (https://www.excelbanter.com/excel-programming/304101-macro-works-2003-not-97-a.html)

CLR[_2_]

Macro works in 2003, not in '97
 
Sorry, no title on previous one............

Hi All..........

I recorded this macro in XL03 and it works fine, in mine, and another 03,
but crashes in two different XL97's on the line starting with
"Selection".........yet other macros in the same book work ok on those
97's.......


Sub SortByWorkorder()

Range("A13").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Sort Key1:=Range("D14"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("a14").Select
Range("D11").Select
End Sub

any advice will be appreciated.........

Vaya con Dios,
Chuck, CABGx3



Jim Rech

Macro works in 2003, not in '97
 
DataOption1 was introduced after Excel 97. Your code will probably work
okay if you get rid of it.

When you're developing for cross-version use, it's best to work in the
lowest version.

--
Jim Rech
Excel MVP

"CLR" wrote in message
...
| Sorry, no title on previous one............
|
| Hi All..........
|
| I recorded this macro in XL03 and it works fine, in mine, and another 03,
| but crashes in two different XL97's on the line starting with
| "Selection".........yet other macros in the same book work ok on those
| 97's.......
|
|
| Sub SortByWorkorder()
|
| Range("A13").Select
| Range(Selection, Selection.End(xlToRight)).Select
| Range(Selection, Selection.End(xlDown)).Select
| Selection.Sort Key1:=Range("D14"), Order1:=xlAscending,
Header:=xlGuess,
| _
| OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
| DataOption1:=xlSortNormal
| Range("a14").Select
| Range("D11").Select
| End Sub
|
| any advice will be appreciated.........
|
| Vaya con Dios,
| Chuck, CABGx3
|
|



CLR

Macro works in 2003, not in '97
 
Thanks Jim.............but I have no clue as to what "Data Option 1" is,
nor how to get rid of it. Would you be so kind as to elaborate?............

I agree about the developing in the enduser's version, however the company I
work for will only provide one version per user. And, there are four users
of this file, two with 2003 and two with 97.


Thanks again,
Vaya con Dios,
Chuck, CABGx3




"Jim Rech" wrote in message
...
DataOption1 was introduced after Excel 97. Your code will probably work
okay if you get rid of it.

When you're developing for cross-version use, it's best to work in the
lowest version.

--
Jim Rech
Excel MVP

"CLR" wrote in message
...
| Sorry, no title on previous one............
|
| Hi All..........
|
| I recorded this macro in XL03 and it works fine, in mine, and another

03,
| but crashes in two different XL97's on the line starting with
| "Selection".........yet other macros in the same book work ok on those
| 97's.......
|
|
| Sub SortByWorkorder()
|
| Range("A13").Select
| Range(Selection, Selection.End(xlToRight)).Select
| Range(Selection, Selection.End(xlDown)).Select
| Selection.Sort Key1:=Range("D14"), Order1:=xlAscending,
Header:=xlGuess,
| _
| OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
| DataOption1:=xlSortNormal
| Range("a14").Select
| Range("D11").Select
| End Sub
|
| any advice will be appreciated.........
|
| Vaya con Dios,
| Chuck, CABGx3
|
|





Jim Rech

Macro works in 2003, not in '97
 
Just delete it from your code. The line will then read:

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

--
Jim Rech
Excel MVP
"CLR" wrote in message
...
| Thanks Jim.............but I have no clue as to what "Data Option 1" is,
| nor how to get rid of it. Would you be so kind as to
elaborate?............
|
| I agree about the developing in the enduser's version, however the company
I
| work for will only provide one version per user. And, there are four
users
| of this file, two with 2003 and two with 97.
|
|
| Thanks again,
| Vaya con Dios,
| Chuck, CABGx3
|
|
|
|
| "Jim Rech" wrote in message
| ...
| DataOption1 was introduced after Excel 97. Your code will probably work
| okay if you get rid of it.
|
| When you're developing for cross-version use, it's best to work in the
| lowest version.
|
| --
| Jim Rech
| Excel MVP
|
| "CLR" wrote in message
| ...
| | Sorry, no title on previous one............
| |
| | Hi All..........
| |
| | I recorded this macro in XL03 and it works fine, in mine, and another
| 03,
| | but crashes in two different XL97's on the line starting with
| | "Selection".........yet other macros in the same book work ok on those
| | 97's.......
| |
| |
| | Sub SortByWorkorder()
| |
| | Range("A13").Select
| | Range(Selection, Selection.End(xlToRight)).Select
| | Range(Selection, Selection.End(xlDown)).Select
| | Selection.Sort Key1:=Range("D14"), Order1:=xlAscending,
| Header:=xlGuess,
| | _
| | OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
| | DataOption1:=xlSortNormal
| | Range("a14").Select
| | Range("D11").Select
| | End Sub
| |
| | any advice will be appreciated.........
| |
| | Vaya con Dios,
| | Chuck, CABGx3
| |
| |
|
|
|
|



CLR

Macro works in 2003, not in '97
 
OIC.........duh, .......I thought you were talking about something else
<blush..........I'll give it a try in the morning at work as I don't have
'97 here at home........

Thanks again,
Vaya con Dios,
Chuck, CABGx3


"Jim Rech" wrote in message
...
Just delete it from your code. The line will then read:

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

--
Jim Rech
Excel MVP
"CLR" wrote in message
...
| Thanks Jim.............but I have no clue as to what "Data Option 1"

is,
| nor how to get rid of it. Would you be so kind as to
elaborate?............
|
| I agree about the developing in the enduser's version, however the

company
I
| work for will only provide one version per user. And, there are four
users
| of this file, two with 2003 and two with 97.
|
|
| Thanks again,
| Vaya con Dios,
| Chuck, CABGx3
|
|
|
|
| "Jim Rech" wrote in message
| ...
| DataOption1 was introduced after Excel 97. Your code will probably

work
| okay if you get rid of it.
|
| When you're developing for cross-version use, it's best to work in the
| lowest version.
|
| --
| Jim Rech
| Excel MVP
|
| "CLR" wrote in message
| ...
| | Sorry, no title on previous one............
| |
| | Hi All..........
| |
| | I recorded this macro in XL03 and it works fine, in mine, and

another
| 03,
| | but crashes in two different XL97's on the line starting with
| | "Selection".........yet other macros in the same book work ok on

those
| | 97's.......
| |
| |
| | Sub SortByWorkorder()
| |
| | Range("A13").Select
| | Range(Selection, Selection.End(xlToRight)).Select
| | Range(Selection, Selection.End(xlDown)).Select
| | Selection.Sort Key1:=Range("D14"), Order1:=xlAscending,
| Header:=xlGuess,
| | _
| | OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,

_
| | DataOption1:=xlSortNormal
| | Range("a14").Select
| | Range("D11").Select
| | End Sub
| |
| | any advice will be appreciated.........
| |
| | Vaya con Dios,
| | Chuck, CABGx3
| |
| |
|
|
|
|





CLR[_2_]

Macro works in 2003, not in '97
 
Thanks again Jim.........I made your recommended change this morning and it
works "finer than frog hair"........

Vaya con Dios,
Chuck, CABGx3




"Jim Rech" wrote in message
...
Just delete it from your code. The line will then read:

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

--
Jim Rech
Excel MVP
"CLR" wrote in message
...
| Thanks Jim.............but I have no clue as to what "Data Option 1"

is,
| nor how to get rid of it. Would you be so kind as to
elaborate?............
|
| I agree about the developing in the enduser's version, however the

company
I
| work for will only provide one version per user. And, there are four
users
| of this file, two with 2003 and two with 97.
|
|
| Thanks again,
| Vaya con Dios,
| Chuck, CABGx3
|
|
|
|
| "Jim Rech" wrote in message
| ...
| DataOption1 was introduced after Excel 97. Your code will probably

work
| okay if you get rid of it.
|
| When you're developing for cross-version use, it's best to work in the
| lowest version.
|
| --
| Jim Rech
| Excel MVP
|
| "CLR" wrote in message
| ...
| | Sorry, no title on previous one............
| |
| | Hi All..........
| |
| | I recorded this macro in XL03 and it works fine, in mine, and

another
| 03,
| | but crashes in two different XL97's on the line starting with
| | "Selection".........yet other macros in the same book work ok on

those
| | 97's.......
| |
| |
| | Sub SortByWorkorder()
| |
| | Range("A13").Select
| | Range(Selection, Selection.End(xlToRight)).Select
| | Range(Selection, Selection.End(xlDown)).Select
| | Selection.Sort Key1:=Range("D14"), Order1:=xlAscending,
| Header:=xlGuess,
| | _
| | OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,

_
| | DataOption1:=xlSortNormal
| | Range("a14").Select
| | Range("D11").Select
| | End Sub
| |
| | any advice will be appreciated.........
| |
| | Vaya con Dios,
| | Chuck, CABGx3
| |
| |
|
|
|
|






All times are GMT +1. The time now is 11:10 AM.

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