ho questo modulo:
- Codice: Seleziona tutto
Sub Ordina()
ActiveSheet.Unprotect
Range("P23024:P23035").Select
ActiveWorkbook.Worksheets("Report finanziario").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Report finanziario").Sort.SortFields.Add Key:= _
Range("P23024"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Report finanziario").Sort
.SetRange Range("P23024:P23035")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("N23028").Select
ActiveWindow.SmallScroll Down:=24
Range("P23039:P23083").Select
ActiveWorkbook.Worksheets("Report finanziario").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Report finanziario").Sort.SortFields.Add Key:= _
Range("P23039"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Report finanziario").Sort
.SetRange Range("P23039:P23083")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("B16:K16").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.Worksheets("Report finanziario").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Report finanziario").Sort.SortFields.Add Key:= _
Range("B16:B23015"), SortOn:=xlSortOnValues, Order:=xlDescending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Report finanziario").Sort
.SetRange Range("B16:K23015")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.Calculation = xlCalculationManual
Range("B16:M23015").Select
Selection.Sort Key1:=Range("M16"), Order1:=xlDescending, Header:=xlNo _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Application.Calculation = xlCalculationAutomatic '
Application.Calculation = xlCalculationManual
Range("B16:L23015").Select
Selection.Sort Key1:=Range("L16"), Order1:=xlDescending, Header:=xlNo _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("E12").Select
Application.Calculation = xlCalculationAutomatic '
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingColumns:=True, AllowFormattingRows:=True
End Sub
Quando applico questa macro mi chiede la pwd!
Come posso fare per risolvere questo problema?
Vorrei che la macro si eseguisse normalmente. Per non farmi chiedere la password devo proteggere il foglio senza poter inserire la mia password privata.
Grazie.
Se avete anche consigli su come migliorare la macro, li accetto volentieri!
Ciao