Sort and Protection written in 98 won't run in 2000 - fix how?

9tanstaafl9

Well-known Member
Joined
Mar 23, 2008
Messages
535
Hi all. I wrote a macro in Excel 98 that is being used in Excel 2000. I don't have a copy of that version to test/figure things out with.

The offending code that seems to be breaking everything is :

Code:
Selection.Sort Key1:=Range("C14"), Order1:=xlAscending, Key2:=Range("B14" _
        ), Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False _
        , Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
        xlSortNormal

and

Code:
ActiveSheet.Protect Password:="ma$terbuilder", DrawingObjects:=True, Contents:=True, Scenarios:=True _
        , AllowFormattingCells:=True, AllowFormattingColumns:=True, _
        AllowFormattingRows:=True



Does anyone know an easy way to make these work in Excel 2000? Better yet (but not strictly necessary), does anyone know how to make the code standardized so it will work for both versions so I don't have to maintain two copies?

Any related links for making code compatible for multiple versions of Excel would be appreciated too, I can't seem to find any info on this as the search terms are too generic and I'm obviously not looking asking the right questions.

Thanks!
Jennifer
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top