sorting cells in a sub routine

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to Sort a block of cells as a step in a routine. The size of the
block varies, but it will always be Sorted in Ascending order by the last
column.
The routine works by having Excel evaluate the CurrentRegion of the
ActiveCell with the CurrentRegion cells surrounding it. If they match, the
sort fires.
All of this works fine except when the sheet is protected.
As far as I can tell, CurrentRegion causes an error message when the sheet
is protected. How else can I establish the area to be sorted?
I'm currently doing it by finding the first and last Columns in the Region
and assigning them as the boundaries.
I'm trying this in Excel 2003 with Sort allowed on a protected sheet.
Thanks,
tj
 
In your code, turn off protection, do your thing, then turn it back on again.
 

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

Back
Top