ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Varying length records to be sorted (https://www.excelbanter.com/excel-programming/380814-re-varying-length-records-sorted.html)

Bob Phillips

Varying length records to be sorted
 
With Worksheets("mySheet")
.Unprotect password:="mypassword"
.Range("A1:M20").Sort Key1:=.Range("C1"), Header:=xlYes
.Protect password:="mypassword", DrawingObjects:=True,
Contents:=True, Scenarios:=True
End With

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Sarah_Lecturer" wrote in message
...
Hiya

I need some code to

1) Unprotect the workbook with the password
2) Select relevant column eg Surname
3) Sort into alphabetical order
4) Reprotect the spreadsheet with the same original password

Any suggestions - Id be grateful

Thanks





All times are GMT +1. The time now is 10:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com