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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,215,650
Messages
6,126,017
Members
449,280
Latest member
Miahr

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