Hi there
I have the following macro
ActiveSheet.Unprotect
Rows("8:337").Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("B8:B61") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A8:F61")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Save
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
What im trying to do is to unprotect sheet by automatically putting in password for me sorting by column "B" and then where there a change in column "B" I need a line to seperate. I.E if in column B its all "A" and then moves onto "B" I need a free row between A & B so they are in blocks. I need to then save and reprotect worksheet inputting password automatically.
Can anyone help.
Thanks
I have the following macro
ActiveSheet.Unprotect
Rows("8:337").Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("B8:B61") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A8:F61")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Save
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
What im trying to do is to unprotect sheet by automatically putting in password for me sorting by column "B" and then where there a change in column "B" I need a line to seperate. I.E if in column B its all "A" and then moves onto "B" I need a free row between A & B so they are in blocks. I need to then save and reprotect worksheet inputting password automatically.
Can anyone help.
Thanks