Desperate for help on assending/decending macros

M

marvontherim

I have built a worksheet that is full of data I need to review it b
specific year as well as assending and decending order. This workshee
also needs to be protected.

I built three buttons with macros. One for return to main menu.
and two more to have the user view the data in assending or decendin
order. I also have a auto filter for specific dates.
Without protecting the worksheet, two of the macros work fine. Th
assending macro brings 0 values to the top and I need to have a valu
greater that 0 in this macro. I don't know how to do that.
When I protect the worksheet the return macro and the autofilter wor
fine but the two assend/ decend macros bring error readings.
Help. I'm getting desperate
Macro's below:
Sub Macro6()
'
' Macro6 Macro
' Macro recorded 6/18/2004 by USER
'

'
Range("A8:F870").Select
Selection.Sort Key1:=Range("A8"), Order1:=xlAscending
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
_
DataOption1:=xlSortNormal
End Sub
Sub Macro7()
'
' Macro7 Macro
' Macro recorded 6/18/2004 by USER
'

'
Range("A8:F870").Select
Selection.Sort Key1:=Range("A8"), Order1:=xlDescending
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
_
DataOption1:=xlSortNormal
End Su
 
J

JulieD

Hi

my first suggestion would be that when you record your macro you record
unprotecting the sheet ... doing the sort and then protecting the sheet
again

this might solve your problem

Cheers
JulieD
 
M

marvontherim

Hi JulieD,
Thank you so much for helping me. That is a great suggestion, it was
right in front of my face. I'll try it and let you know.
Can you help me out with the Assending sorting that brings 0's to the
top. I need a modification to the macro to say greater than 0.
Thanks again.
 
M

marvontherim

Hi JulieD,
Unprotect inthe macro works just fine.
Thanks
adding > 0 to the macro is my next challange
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top