Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Any input on why these macros would work in 02 and not 97. I have a couple PC's that are running 97 others run 2002. All 2002 work fine
Thanks in advanc Private Sub CommandButton1_DblClick(ByVal Cancel As MSForms.ReturnBoolean ActiveSheet.Unprotect ("Password" Worksheets("Focus List").Range("A2:A125").Sort Key1:=Worksheets("Focus List").Range("A2"), Order1:=xlDescendin Worksheets("Focus List").Range("B2:B125").Sort Key1:=Worksheets("Focus List").Range("B2"), Order1:=xlDescendin Worksheets("Focus List").Range("C2:C125").Sort Key1:=Worksheets("Focus List").Range("C2"), Order1:=xlDescendin Worksheets("Focus List").Range("D2:D125").Sort Key1:=Worksheets("Focus List").Range("D2"), Order1:=xlDescendin Worksheets("Focus List").Range("E2:E125").Sort Key1:=Worksheets("Focus List").Range("E2"), Order1:=xlDescendin Worksheets("Focus List").Range("F2:F125").Sort Key1:=Worksheets("Focus List").Range("F2"), Order1:=xlDescendin Worksheets("Focus List").Range("G2:G125").Sort Key1:=Worksheets("Focus List").Range("G2"), Order1:=xlDescendin Worksheets("Focus List").Range("H2:H125").Sort Key1:=Worksheets("Focus List").Range("H2"), Order1:=xlDescendin Worksheets("Focus List").Range("I2:I125").Sort Key1:=Worksheets("Focus List").Range("I2"), Order1:=xlDescendin Worksheets("Focus List").Range("J2:J125").Sort Key1:=Worksheets("Focus List").Range("J2"), Order1:=xlDescendin ActiveSheet.Protect Scenarios:=True, UserInterfaceOnly:=Tru End Su second one not workin Private Sub CommandButton1_DblClick(ByVal Cancel As MSForms.ReturnBoolean Worksheets("Sales Consultants").Range("A3:F125").Sort Key1:=Worksheets("Sales Consultants").Range("A3" End Su |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm betting that the commandbutton's are from the control toolbox toolbar and
placed directly on a worksheet. There's a bug in excel97 that was fixed in xl2k. Either set the .takefocusonclick property to false (manually) for each button. Or add a line like this: activecell.activate to the top of each procedure that is invoked by clicking on one of those control toolbox toolbar controls. Alex Ray wrote: Any input on why these macros would work in 02 and not 97. I have a couple PC's that are running 97 others run 2002. All 2002 work fine. Thanks in advance Private Sub CommandButton1_DblClick(ByVal Cancel As MSForms.ReturnBoolean) ActiveSheet.Unprotect ("Password") Worksheets("Focus List").Range("A2:A125").Sort _ Key1:=Worksheets("Focus List").Range("A2"), Order1:=xlDescending Worksheets("Focus List").Range("B2:B125").Sort _ Key1:=Worksheets("Focus List").Range("B2"), Order1:=xlDescending Worksheets("Focus List").Range("C2:C125").Sort _ Key1:=Worksheets("Focus List").Range("C2"), Order1:=xlDescending Worksheets("Focus List").Range("D2:D125").Sort _ Key1:=Worksheets("Focus List").Range("D2"), Order1:=xlDescending Worksheets("Focus List").Range("E2:E125").Sort _ Key1:=Worksheets("Focus List").Range("E2"), Order1:=xlDescending Worksheets("Focus List").Range("F2:F125").Sort _ Key1:=Worksheets("Focus List").Range("F2"), Order1:=xlDescending Worksheets("Focus List").Range("G2:G125").Sort _ Key1:=Worksheets("Focus List").Range("G2"), Order1:=xlDescending Worksheets("Focus List").Range("H2:H125").Sort _ Key1:=Worksheets("Focus List").Range("H2"), Order1:=xlDescending Worksheets("Focus List").Range("I2:I125").Sort _ Key1:=Worksheets("Focus List").Range("I2"), Order1:=xlDescending Worksheets("Focus List").Range("J2:J125").Sort _ Key1:=Worksheets("Focus List").Range("J2"), Order1:=xlDescending ActiveSheet.Protect Scenarios:=True, UserInterfaceOnly:=True End Sub second one not working Private Sub CommandButton1_DblClick(ByVal Cancel As MSForms.ReturnBoolean) Worksheets("Sales Consultants").Range("A3:F125").Sort _ Key1:=Worksheets("Sales Consultants").Range("A3") End Sub -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to update a column in a work based on another work sheet | New Users to Excel | |||
Macro works Macro does not work | Excel Discussion (Misc queries) | |||
how to get a macro to work | Excel Discussion (Misc queries) | |||
Why does the macro not work? | Excel Worksheet Functions | |||
how do you get (end down) to work in a macro? | Excel Worksheet Functions |