
Sub Auto_open()
Dim ur As Integer
With Worksheets("Venezia")
ur = .Cells(Rows.Count, 6).End(xlUp).Row
For n = ur To 2 Step -1
If .Cells(n, 6).Value < mydate Then
.Cells(n, 6).EntireRow.Delete
End If
Next n
End With
With Worksheets("Chioggia")
ur = .Cells(Rows.Count, 7).End(xlUp).Row
For n = ur To 2 Step -1
If .Cells(n, 7).Value = "X" Then
.Cells(n, 7).EntireRow.Delete
End If
Next n
End With
With Worksheets("Jesolo")
ur = .Cells(Rows.Count, 7).End(xlUp).Row
For n = ur To 2 Step -1
If .Cells(n, 7).Value = "X" Then
.Cells(n, 7).EntireRow.Delete
End If
Next n
End With
With Worksheets("Caorle")
ur = .Cells(Rows.Count, 7).End(xlUp).Row
For n = ur To 2 Step -1
If .Cells(n, 7).Value = "X" Then
.Cells(n, 7).EntireRow.Delete
End If
Next n
End With
With Worksheets("Venezia").Range("A3:F500")
With .Font
.Name = "Calibri"
.Bold = False
.Size = 11
End With
End With
With Worksheets("Chioggia").Range("A3:F500")
With .Font
.Name = "Calibri"
.Bold = False
.Size = 11
End With
End With
With Worksheets("Jesolo").Range("A3:F500")
With .Font
.Name = "Calibri"
.Bold = False
.Size = 11
End With
End With
With Worksheets("Caorle").Range("A3:F500")
With .Font
.Name = "Calibri"
.Bold = False
.Size = 11
End With
End With
End Sub |
Private Sub Workbook_Open()
Dim UR As Long, N As Long, Colonna As Long
Dim shName As Variant, Cella As Range, Cancella As Boolean
For Each shName In Array("Venezia", "Chioggia", "Jesolo", "Caorle")
If shName = "Venezia" Then Colonna = 7 Else Colonna = 6
With Sheets(shName)
UR = .Cells(Rows.Count, Colonna).End(xlUp).Row
For N = UR To 2 Step -1
If shName = "Venezia" Then
Cancella = .Cells(N, Colonna).Value < mydate
Else
Cancella = .Cells(N, Colonna).Value = "X"
End If
If Cancella Then
.Cells(N, Colonna).EntireRow.Delete
End If
Next N
With .Range("A3:F500").Font
.Name = "Calibri"
.Bold = False
.Size = 11
End With
For Each Cella In .Range("A3:F500").Cells
Cella.Value = UCase(Cella.Value)
Next Cella
End With
Next shName
End Sub |
Private Sub Workbook_Open()
Dim UR As Long, N As Long, Calculation As XlCalculation
Dim shName As Variant, Cella As Range
'le prossime tre istruzioni servono a velocizzare l'esecuzione
Calculation = Application.Calculation 'salva la modalità di ricalcolo
Application.Calculation = xlCalculationManual 'disabilita ricalcolo automatico
Application.ScreenUpdating = False 'disabilita l'aggiornamento della schermata
For Each shName In Array("Venezia", "Chioggia", "Jesolo", "Caorle")
With Sheets(shName)
UR = .Cells(Rows.Count, 6).End(xlUp).Row
For N = UR To 2 Step -1
If CDate(.Cells(N, 6).Value) < Date Then
.Cells(N, 6).EntireRow.Delete
End If
Next N
For Each Cella In .UsedRange.Cells 'tutte le celle utilizzate nel foglio
Cella.Value = UCase(Cella.Value) 'trasforma in maiuscolo
With Cella.Font
.Name = "Calibri"
.Bold = False
.Size = 11
End With
Next Cella
End With
Next shName
Application.Calculation = Calculation 'ripristina modalità di ricalcolo
Application.ScreenUpdating = True 'ripristina aggiornamento schermata
End Sub |
Private Sub Workbook_Open()
Dim UR As Long, N As Long, Calculation As XlCalculation
Dim shName As Variant, Cella As Range
'le prossime tre istruzioni servono a velocizzare l'esecuzione
Calculation = Application.Calculation 'salva la modalità di ricalcolo
Application.Calculation = xlCalculationManual 'disabilita ricalcolo automatico
Application.ScreenUpdating = False 'disabilita l'aggiornamento della schermata
For Each shName In Array("Venezia", "Chioggia", "Jesolo", "Caorle")
With Sheets(shName)
UR = .Cells(Rows.Count, 6).End(xlUp).Row
For N = UR To 3 Step -1
If IsDate(.Cells(N, 6).Value) Then
If CDate(.Cells(N, 6).Value) < Date Then
.Cells(N, 6).EntireRow.Delete
End If
End If
Next N
For Each Cella In .UsedRange.Cells 'tutte le celle utilizzate nel foglio
Cella.Value = UCase(Cella.Value) 'trasforma in maiuscolo
With Cella.Font
.Name = "Calibri"
.Bold = False
.Size = 11
End With
Next Cella
End With
Next shName
Application.Calculation = Calculation 'ripristina modalità di ricalcolo
Application.ScreenUpdating = True 'ripristina aggiornamento schermata
End Sub |
