Moderatori: Anthony47, Flash30005
=SE(VAL.ERRORE(CERCA.VERT(E1;A$1:B$13;2;0));-1;CERCA.VERT(E1;A$1:B$13;2;0))
Sub Inserisci_Intervalli_Mancanti()
Dim UR As Long, I As Integer
Sheets("Foglio1").Select
UR = Range("B" & Rows.Count).End(xlUp).Row
For I = UR - 1 To 2 Step -1
aa = Cells(I + 1, 2) - Cells(I, 2)
If Round(Cells(I + 1, 2) - Cells(I, 2), 14) > 10 / 1440 Then
Rows(I + 1).Insert Shift:=xlDown
Cells(I + 1, 1) = Cells(I + 2, 1)
Cells(I + 1, 2) = Cells(I + 2, 2) - 10 / 1440
I = I + 1
'
' QUI vanno le istruzioni che impostano i dati nelle altre celle da "C" a "Z"
'
End If
Next I
MsgBox "Elaborazione Conclusa"
End Sub
Sub Inserisci_Intervalli_Mancanti()
Dim UR As Long, I As Integer, mCalcola As Variant, Aggiunti As Long
mCalcola = Application.Calculation
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Sheets("Foglio1").Select
UR = Range("B" & Rows.Count).End(xlUp).Row
Aggiunti = 0
For I = UR - 1 To 2 Step -1
If Cells(I + 1, 2) <> "" Then ' <<===== Aggiunta per eliminare l'errore
If Round(Cells(I + 1, 2) - Cells(I, 2), 10) > 10 / 1440 Then
Rows(I + 1).Insert Shift:=xlDown
Cells(I + 1, 1) = Cells(I + 2, 1)
Cells(I + 1, 2) = Cells(I + 2, 2) - 10 / 1440
I = I + 1
Aggiunti = Aggiunti + 1
'
' QUI vanno le istruzioni che impostano i dati nelle altre celle da "C" a "Z"
'
End If
Else ' <<===== può essere tolta dopo le prove
MsgBox "La riga " & I + 1 & " contiene dati non validi" ' <<===== può essere tolta dopo le prove
Exit Sub ' <<===== può essere tolta dopo le prove
End If
Next I
Application.ScreenUpdating = True
Application.Calculation = mCalcola
MsgBox "Elaborazione Conclusa" & vbCrLf & vbCrLf & "Aggiunti: '" & Aggiunti & "' intervalli"
End Sub
Torna a Applicazioni Office Windows
Macro modifica date scelta periodo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 11 |
Supporto per sviluppo macro VBA Ordinare per data Autore: Carletto Ribolla |
Forum: Applicazioni Office Windows Risposte: 3 |
Inserire add.in nella barra di avvio veloce in excel 2003 Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 4 |
Excel: problema con date se devo unirle a testi Autore: valle1975 |
Forum: Applicazioni Office Windows Risposte: 5 |
Visitano il forum: Nessuno e 20 ospiti